mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
update files
add _DEFAULT_SOURCE to avoid warnings fix cppcheck messages
This commit is contained in:
parent
d23429891e
commit
9033c51bb4
@ -71,7 +71,7 @@ package_libnetctlgui() {
|
||||
|
||||
package_netctlgui-helper() {
|
||||
pkgdesc="Helper daemon for netctl-gui. A part of netctl-gui"
|
||||
depends=('libnetctlgui')
|
||||
depends=("libnetctlgui=${pkgver}")
|
||||
provides=('netctlgui-helper-qt4')
|
||||
conflicts=('netctlgui-helper-qt4')
|
||||
backup=('etc/netctl-gui.conf'
|
||||
@ -85,7 +85,7 @@ package_netctlgui-helper() {
|
||||
|
||||
package_netctl-gui() {
|
||||
pkgdesc="Qt5 graphical front-end for netctl. A part of netctl-gui"
|
||||
depends=('libnetctlgui' 'xdg-utils')
|
||||
depends=("libnetctlgui=${pkgver}" 'xdg-utils')
|
||||
optdepends=('plasma-netctl-gui: KF5 widget'
|
||||
'netctlgui-helper: DBus helper daemon')
|
||||
provides=('netctl-gui-qt4')
|
||||
|
@ -73,7 +73,7 @@ package_libnetctlgui-qt4() {
|
||||
|
||||
package_netctlgui-helper-qt4() {
|
||||
pkgdesc="Helper daemon for netctl-gui. A part of netctl-gui"
|
||||
depends=('libnetctlgui-qt4')
|
||||
depends=("libnetctlgui-qt4=${pkgver}")
|
||||
provides=('netctlgui-helper')
|
||||
conflicts=('netctlgui-helper')
|
||||
backup=('etc/netctl-gui.conf'
|
||||
@ -87,7 +87,7 @@ package_netctlgui-helper-qt4() {
|
||||
|
||||
package_netctl-gui-qt4() {
|
||||
pkgdesc="Qt4 graphical front-end for netctl. A part of netctl-gui"
|
||||
depends=('libnetctlgui-qt4')
|
||||
depends=("libnetctlgui-qt4=${pkgver}")
|
||||
optdepends=('kdeplasma-applets-netctl-gui: KDE widget'
|
||||
'netctlgui-helper-qt4: DBus helper daemon')
|
||||
provides=('netctl-gui')
|
||||
|
@ -55,6 +55,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set (CMAKE_CXX_FLAGS "-Wall -std=c++11")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
||||
# avoid newer gcc warnings
|
||||
add_definitions (-D_DEFAULT_SOURCE)
|
||||
else ()
|
||||
message (STATUS "Unknown compiler")
|
||||
endif ()
|
||||
|
@ -114,7 +114,7 @@ void SettingsWindow::closeWindow()
|
||||
|
||||
saveSettings();
|
||||
close();
|
||||
((MainWindow *)parent())->updateConfiguration();
|
||||
dynamic_cast<MainWindow *>(parent())->updateConfiguration();
|
||||
}
|
||||
|
||||
|
||||
@ -467,7 +467,7 @@ void SettingsWindow::startHelper()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
((MainWindow *)parent())->startHelper();
|
||||
dynamic_cast<MainWindow *>(parent())->startHelper();
|
||||
updateHelper();
|
||||
}
|
||||
|
||||
@ -476,12 +476,12 @@ void SettingsWindow::updateHelper()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
if (((MainWindow *)parent())->isHelperServiceActive()) {
|
||||
if (dynamic_cast<MainWindow *>(parent())->isHelperServiceActive()) {
|
||||
ui->label_status->setText(QApplication::translate("SettingsWindow", "Active (systemd)"));
|
||||
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop"));
|
||||
ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop"));
|
||||
ui->pushButton_status->setDisabled(true);
|
||||
} else if (((MainWindow *)parent())->isHelperActive()) {
|
||||
} else if (dynamic_cast<MainWindow *>(parent())->isHelperActive()) {
|
||||
ui->label_status->setText(QApplication::translate("SettingsWindow", "Active"));
|
||||
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop"));
|
||||
ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop"));
|
||||
|
@ -30,7 +30,7 @@ TrayIcon::TrayIcon(QObject *parent, const bool debugCmd)
|
||||
: QSystemTrayIcon(parent),
|
||||
debug(debugCmd)
|
||||
{
|
||||
mainWindow = (MainWindow *)parent;
|
||||
mainWindow = dynamic_cast<MainWindow *>(parent);
|
||||
|
||||
init();
|
||||
}
|
||||
|
@ -98,22 +98,22 @@ protected:
|
||||
|
||||
private:
|
||||
// ui
|
||||
QWidget *graphicsWidget;
|
||||
QHBoxLayout *layout;
|
||||
IconLabel *iconLabel;
|
||||
QLabel *textLabel;
|
||||
QWidget *graphicsWidget = nullptr;
|
||||
QHBoxLayout *layout = nullptr;
|
||||
IconLabel *iconLabel = nullptr;
|
||||
QLabel *textLabel = nullptr;
|
||||
// information
|
||||
bool status;
|
||||
bool status = false;
|
||||
QMap<QString, QString> info;
|
||||
QStringList profileList;
|
||||
// context menu
|
||||
void createActions();
|
||||
QList<QAction*> menuActions;
|
||||
QMenu *startProfileMenu;
|
||||
QMenu *switchToProfileMenu;
|
||||
QMenu *startProfileMenu = nullptr;
|
||||
QMenu *switchToProfileMenu = nullptr;
|
||||
QMap<QString, QAction*> contextMenu;
|
||||
// data engine
|
||||
Plasma::DataEngine *netctlEngine;
|
||||
Plasma::DataEngine *netctlEngine = nullptr;
|
||||
void connectToEngine();
|
||||
void disconnectFromEngine();
|
||||
QList<QVariant> sendDBusRequest(const QString cmd, const QList<QVariant> args = QList<QVariant>());
|
||||
@ -123,13 +123,15 @@ private:
|
||||
Ui::ConfigWindow uiWidConfig;
|
||||
Ui::About uiAboutConfig;
|
||||
// configuration
|
||||
int autoUpdateInterval;
|
||||
bool bigInterface;
|
||||
bool debug;
|
||||
QString textPattern;
|
||||
int autoUpdateInterval = 1000;
|
||||
bool bigInterface = true;
|
||||
bool debug = false;
|
||||
QString textPattern = QString();
|
||||
QStringList formatLine;
|
||||
QMap<QString, QString> paths;
|
||||
bool useHelper, useSudo, useWifi;
|
||||
bool useHelper = true;
|
||||
bool useSudo = false;
|
||||
bool useWifi = false;
|
||||
};
|
||||
|
||||
K_EXPORT_PLASMA_APPLET(netctl, Netctl)
|
||||
|
Loading…
Reference in New Issue
Block a user