summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-06-08 11:01:21 +0800
committerIru Cai <mytbk920423@gmail.com>2018-06-08 11:28:29 +0800
commitee5c3462b3d470097625bf4426f2453fb335f632 (patch)
treeab8a92dc68499e0d068f694f9f63b9508e5734d6
parent94d81c6a60a85ad216ee494678bd2965bfd6ffb5 (diff)
downloadfqterm-ee5c3462b3d470097625bf4426f2453fb335f632.tar.xz
clean up fqterm_app
-rw-r--r--src/fqterm/CMakeLists.txt2
-rw-r--r--src/fqterm/fqterm_app.cpp38
-rw-r--r--src/fqterm/fqterm_app.h41
-rw-r--r--src/fqterm/fqterm_frame.h2
-rw-r--r--src/fqterm/main.cpp7
5 files changed, 2 insertions, 88 deletions
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 <QApplication>
-#include <QObject>
-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 <QMainWindow>
#include <QSystemTrayIcon>
#include <QMenuBar>
-
+#include <QTranslator>
#include <vector>
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 <QApplication>
-#include <QTranslator>
#include <QFontDatabase>
#include <QTextCodec>
#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();
}