diff --git a/src/main.cpp b/src/main.cpp index 40bfef2a..41a85703 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,8 +29,6 @@ #include "xatom-helper.h" #endif -#include "threaddriver.h" - #define LOG_IDENT "ukui_kylin_nm" void messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) @@ -99,13 +97,11 @@ int main(int argc, char *argv[]) QApplication::setQuitOnLastWindowClosed(false); - ThreadDriver networkManagerDiver; QThread thread; KyNetworkResourceManager *p_networkResource = KyNetworkResourceManager::getInstance(); p_networkResource->moveToThread(&thread); - QObject::connect(&networkManagerDiver, SIGNAL(initSignal()), p_networkResource, SLOT(onInitNetwork())); + QObject::connect(&thread, SIGNAL(started()), p_networkResource, SLOT(onInitNetwork())); thread.start(); - networkManagerDiver.emitSignal(); // Internationalization QString locale = QLocale::system().name(); diff --git a/src/src.pro b/src/src.pro index 109a25f4..eb6419ed 100644 --- a/src/src.pro +++ b/src/src.pro @@ -66,6 +66,3 @@ unix { DISTFILES += \ org.ukui.kylin-nm.switch.gschema.xml - -HEADERS += \ - threaddriver.h diff --git a/src/threaddriver.h b/src/threaddriver.h deleted file mode 100644 index 0cc30ffd..00000000 --- a/src/threaddriver.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef THREADDRIVER_H -#define THREADDRIVER_H - - -#include -#include -#include -#include - -class ThreadDriver:public QObject -{ - Q_OBJECT -public: - ThreadDriver(QObject* parent=0):QObject(parent){} - -public slots: - void emitSignal() { - emit initSignal(); - } - -signals: - void initSignal(); -}; - -#endif // THREADDRIVER_H