From ee5c3462b3d470097625bf4426f2453fb335f632 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Fri, 8 Jun 2018 11:01:21 +0800 Subject: clean up fqterm_app --- src/fqterm/CMakeLists.txt | 2 -- src/fqterm/fqterm_app.cpp | 38 -------------------------------------- src/fqterm/fqterm_app.h | 41 ----------------------------------------- src/fqterm/fqterm_frame.h | 2 +- src/fqterm/main.cpp | 7 +------ 5 files changed, 2 insertions(+), 88 deletions(-) delete mode 100644 src/fqterm/fqterm_app.cpp delete mode 100644 src/fqterm/fqterm_app.h diff --git a/src/fqterm/CMakeLists.txt b/src/fqterm/CMakeLists.txt index 7a9f92d..80bc734 100644 --- a/src/fqterm/CMakeLists.txt +++ b/src/fqterm/CMakeLists.txt @@ -1,12 +1,10 @@ set(CMAKE_AUTOMOC ON) set(fqterm_SRCS - fqterm_app.h fqterm_frame.h fqterm_screen.h fqterm_window.h fqterm_wndmgr.h - fqterm_app.cpp fqterm_frame.cpp fqterm_screen.cpp fqterm_window.cpp diff --git a/src/fqterm/fqterm_app.cpp b/src/fqterm/fqterm_app.cpp deleted file mode 100644 index 393355a..0000000 --- a/src/fqterm/fqterm_app.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************** - * fqterm, a terminal emulator for both BBS and *nix. * - * Copyright (C) 2008 fqterm development group. * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - ***************************************************************************/ - -#include "fqterm_app.h" - -namespace FQTerm { - -FQTermApplication::FQTermApplication( int & argc, char ** argv ) : QApplication(argc, argv) -{ - -} - -void FQTermApplication::commitData( QSessionManager & manager ) -{ - emit saveData(); -} - - -} //namespace FQTerm - -#include "fqterm_app.moc" \ No newline at end of file diff --git a/src/fqterm/fqterm_app.h b/src/fqterm/fqterm_app.h deleted file mode 100644 index ee0778a..0000000 --- a/src/fqterm/fqterm_app.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** - * fqterm, a terminal emulator for both BBS and *nix. * - * Copyright (C) 2008 fqterm development group. * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - ***************************************************************************/ - -#ifndef FQTERM_APP -#define FQTERM_APP -#include -#include -namespace FQTerm { - -class FQTermApplication : public QApplication { - Q_OBJECT; -public: - FQTermApplication(int & argc, char ** argv); -protected: - virtual void commitData(QSessionManager & manager); -signals: - void saveData(); -protected slots: - void mainWindowDestroyed(QObject* obj) {quit();} -}; - -} //namespace FQTerm - -#endif \ No newline at end of file diff --git a/src/fqterm/fqterm_frame.h b/src/fqterm/fqterm_frame.h index e521403..c3f36f7 100644 --- a/src/fqterm/fqterm_frame.h +++ b/src/fqterm/fqterm_frame.h @@ -24,7 +24,7 @@ #include #include #include - +#include #include class QWidget; diff --git a/src/fqterm/main.cpp b/src/fqterm/main.cpp index c397870..8efa99c 100644 --- a/src/fqterm/main.cpp +++ b/src/fqterm/main.cpp @@ -68,12 +68,10 @@ #endif #include -#include #include #include #include "fqterm.h" -#include "fqterm_app.h" #include "fqterm_frame.h" #include "fqterm_path.h" #include "fqterm_trace.h" @@ -84,7 +82,7 @@ int main(int argc, char **argv) { - FQTerm::FQTermApplication a(argc, argv); + QApplication a(argc, argv); // Set trace categories and level. FQTerm::setMaxTraceLevel(1); for (int i = 1; i < argc; ++i) { @@ -124,8 +122,5 @@ int main(int argc, char **argv) { mw->setWindowTitle("FQTerm " + QString(FQTERM_VERSION_STRING)); mw->setWindowIcon(QPixmap(getPath(RESOURCE) + "pic/fqterm.png")); mw->show(); - a.setQuitOnLastWindowClosed(false); - FQ_VERIFY(a.connect(mw, SIGNAL(destroyed(QObject*)), &a, SLOT(mainWindowDestroyed(QObject*)), Qt::QueuedConnection)); - FQ_VERIFY(a.connect(&a, SIGNAL(saveData()), mw, SLOT(saveSetting()))); return a.exec(); } -- cgit v1.2.3