diff --git a/backthread.cpp b/backthread.cpp index 616874b6..cb5f4905 100644 --- a/backthread.cpp +++ b/backthread.cpp @@ -19,6 +19,7 @@ #include "backthread.h" #include +#include #include #include diff --git a/confform.cpp b/confform.cpp index 10569949..238e7343 100644 --- a/confform.cpp +++ b/confform.cpp @@ -21,6 +21,9 @@ #include "kylin-network-interface.h" #include "backthread.h" +#include +#include + extern QString llname, lwname; ConfForm::ConfForm(QWidget *parent) : diff --git a/debian/changelog b/debian/changelog index 3f4d604a..f5c11c70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ kylin-nm (1.2.0-1) unstable; urgency=medium * debian/control: - Bump standards-version to 4.5.0. + [ lixiang ] + * update kylin-nm.pro and rules. + -- handsome_feng Tue, 25 Feb 2020 14:12:29 +0800 kylin-nm (1.0.4-1) unstable; urgency=medium diff --git a/debian/control b/debian/control index 925b0062..44547e19 100644 --- a/debian/control +++ b/debian/control @@ -3,10 +3,15 @@ Section: utils Priority: optional Maintainer: Kylin Team Uploaders: handsome_feng -Build-Depends: debhelper-compat (= 12), +Build-Depends: debhelper-compat (>= 12), qtbase5-dev, + qt5-qmake, + qtchooser, + qtscript5-dev, + qttools5-dev-tools, + qtbase5-dev-tools, libnotify-bin, - libqt5x11extras5-dev (>= 5.11.1-2), + libqt5x11extras5-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/kylin-nm @@ -15,8 +20,7 @@ Vcs-Browser: https://github.com/ukui/kylin-nm Package: kylin-nm Architecture: any -Depends: libqt5x11extras5 (>= 5.11.1-2), - network-manager (>=1.12.4), +Depends: network-manager (>=1.12.4), libnotify-bin, ${shlibs:Depends}, ${misc:Depends} diff --git a/debian/rules b/debian/rules index d35b2f06..545fc119 100755 --- a/debian/rules +++ b/debian/rules @@ -1,8 +1,30 @@ #!/usr/bin/make -f -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 -export QT_SELECT := qt5 + +export QT_SELECT=5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all +QMAKE_OPTS = DEFINES+=NO_DEBUG_ON_CONSOLE +MAKE_OPTS = PREFIX=/usr QMAKE=qmake LRELEASE=lrelease QMAKE_OPTS="$(QMAKE_OPTS)" + +override_dh_auto_configure: + QT_SELECT=qt5 dh_auto_configure \ + -- "QMAKE_CXXFLAGS=$(CFLAGS)" \ + kylin-nm.pro + %: dh $@ + +override_dh_install: + dh_install + +override_dh_missing: + dh_missing --fail-missing + +override_dh_auto_clean: + [ ! -d .moc ] || $(RM) -r .moc + [ ! -d .obj ] || $(RM) -r .obj + [ ! -d .ui ] || $(RM) -r .ui + [ ! -f Makefile ] || dh_auto_clean + +override_dh_auto_build: + dh_auto_build -- $(MAKE_OPTS) diff --git a/kylin-network-interface.c b/kylin-network-interface.c index 961bd1c6..31178b6d 100644 --- a/kylin-network-interface.c +++ b/kylin-network-interface.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/kylin-nm.pro b/kylin-nm.pro index 8b6cb0bf..f26cba45 100644 --- a/kylin-nm.pro +++ b/kylin-nm.pro @@ -9,7 +9,7 @@ QT += core gui x11extras dbus greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = kylin-nm - +TEMPLATE = app #CONFIG += link_pkgconfig #PKGCONFIG += libnm glib-2.0 gio-2.0 dbus-glib-1 #PKGCONFIG += Qt5Svg @@ -23,8 +23,6 @@ desktop.files = kylin-nm.desktop INSTALLS += target \ desktop -TEMPLATE = app - # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the @@ -36,6 +34,11 @@ DEFINES += QT_DEPRECATED_WARNINGS # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS) +QMAKE_CFLAGS *= $(shell dpkg-buildflags --get CFLAGS) +QMAKE_CXXFLAGS *= $(shell dpkg-buildflags --get CXXFLAGS) +QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS) + SOURCES += \ main.cpp \ @@ -105,5 +108,11 @@ FORMS += \ RESOURCES += \ nmqrc.qrc +unix { + UI_DIR = .ui + MOC_DIR = .moc + OBJECTS_DIR = .obj +} + TRANSLATIONS = translations/kylin-nm_zh_CN.ts \ translations/kylin-nm_bo.ts diff --git a/mainwindow.cpp b/mainwindow.cpp index 974b8657..1143463b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -96,7 +96,7 @@ MainWindow::MainWindow(QWidget *parent) : "QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}"); btnAddNet->setFocusPolicy(Qt::NoFocus); btnAddNet->show(); - connect(btnAddNet,SIGNAL(clicked()),this,SLOT(on_btnAddNet_clicked())); + connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked())); scrollAreal = new QScrollArea(ui->centralWidget); scrollAreal->move(41, 158); @@ -1034,7 +1034,7 @@ void MainWindow::loadWifiListDone(QStringList slist) "QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}"); btnAddNet->setFocusPolicy(Qt::NoFocus); btnAddNet->show(); - connect(btnAddNet,SIGNAL(clicked()),this,SLOT(on_btnAddNet_clicked())); + connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked())); // 清空wifi列表 wifiListWidget = new QWidget(scrollAreaw); @@ -1476,7 +1476,7 @@ void MainWindow::on_btnWifiList_clicked() "QPushButton:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}"); btnAddNet->setFocusPolicy(Qt::NoFocus); btnAddNet->show(); - connect(btnAddNet,SIGNAL(clicked()),this,SLOT(on_btnAddNet_clicked())); + connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked())); // 清空wifi列表 wifiListWidget = new QWidget(scrollAreaw); @@ -2265,7 +2265,7 @@ void MainWindow::on_btnHotspotState() is_hot_sopt_on = 0; } -void MainWindow::on_btnAddNet_clicked() +void MainWindow::onBtnAddNetClicked() { QApplication::setQuitOnLastWindowClosed(false); DlgConnHidWifi *connHidWifi = new DlgConnHidWifi(0, this); diff --git a/mainwindow.h b/mainwindow.h index 1cfee7c8..0f6e65ae 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -105,6 +105,8 @@ public: QString currSelNetName = ""; //当前ScrollArea中选中的网络名称 + void on_btnNetList_clicked(int flag=0); + public slots: void onPhysicalCarrierChanged(bool flag); void onCarrierUpHandle(); @@ -196,7 +198,6 @@ private slots: void on_btnNet_clicked(); void on_btnWifi_clicked(); - void on_btnNetList_clicked(int flag=0); void on_btnWifiList_clicked(); void getLanListDone(QStringList slist); @@ -234,7 +235,7 @@ private slots: void iconStep(); void on_btnFlyMode_clicked(); - void on_btnAddNet_clicked(); + void onBtnAddNetClicked(); signals: void deleteRedundantNet(); diff --git a/networkspeed.cpp b/networkspeed.cpp index e55bc0f9..17294320 100644 --- a/networkspeed.cpp +++ b/networkspeed.cpp @@ -1,4 +1,5 @@ #include "networkspeed.h" +#include NetworkSpeed::NetworkSpeed(QObject *parent) :QObject(parent) { @@ -9,10 +10,10 @@ int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long * { FILE * net_dev_file; //文件指针 char buffer[1024]; //文件中的内容暂存在字符缓冲区里 - size_t bytes_read; //实际读取的内容大小 + //size_t bytes_read; //实际读取的内容大小 char * match; //用以保存所匹配字符串及之后的内容 int counter = 0; - int i = 0; + //int i = 0; char tmp_value[128]; if((NULL == netname)||(NULL == save_rate)||(NULL == tx_rate)){ @@ -39,7 +40,7 @@ int NetworkSpeed::getCurrentDownloadRates(char *netname, long *save_rate, long * memset(tmp_value,0,sizeof(tmp_value)); sscanf(match,"%s ",tmp_value); match = match + strlen(tmp_value); - for(i=0;i +#include DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget *parent) : isUsed(type),