┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/services')
-rw-r--r--src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp24
-rw-r--r--src/settings/services/servicessettingspage.cpp40
-rw-r--r--src/settings/services/servicessettingspage.h23
-rw-r--r--src/settings/services/test/service_menu_deinstallation_test.rb17
-rw-r--r--src/settings/services/test/service_menu_installation_test.rb17
-rw-r--r--src/settings/services/test/test_helper.rb17
-rwxr-xr-xsrc/settings/services/test/test_run.rb17
7 files changed, 38 insertions, 117 deletions
diff --git a/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp b/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp
index 89f2545f8..459c57fed 100644
--- a/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp
+++ b/src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp
@@ -1,22 +1,8 @@
-/***************************************************************************
- * Copyright © 2019 Alexander Potashev <[email protected]> *
- * *
- * 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) version 3 or any later version *
- * accepted by the membership of KDE e.V. (or its successor approved *
- * by the membership of KDE e.V.), which shall act as a proxy *
- * defined in Section 14 of version 3 of the license. *
- * *
- * 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, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2019 Alexander Potashev <[email protected]>
+ *
+ * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
+ */
#include <QDebug>
#include <QProcess>
diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp
index e18bfb09e..fa064d8a1 100644
--- a/src/settings/services/servicessettingspage.cpp
+++ b/src/settings/services/servicessettingspage.cpp
@@ -1,21 +1,8 @@
-/***************************************************************************
- * Copyright (C) 2009-2010 by Peter Penz <[email protected]> *
- * *
- * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2009-2010 Peter Penz <[email protected]>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
#include "servicessettingspage.h"
@@ -31,11 +18,12 @@
#include <KPluginMetaData>
#include <KService>
#include <KServiceTypeTrader>
-#include <kdesktopfileactions.h>
+#include <KDesktopFileActions>
#include <QGridLayout>
#include <QLabel>
#include <QListWidget>
+#include <QScroller>
#include <QShowEvent>
#include <QSortFilterProxyModel>
#include <QLineEdit>
@@ -69,6 +57,8 @@ ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
});
m_listView = new QListView(this);
+ QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
+
auto *delegate = new ServiceItemDelegate(m_listView, m_listView);
m_serviceModel = new ServiceModel(this);
m_sortModel = new QSortFilterProxyModel(this);
@@ -82,15 +72,25 @@ ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
connect(m_listView, &QListView::clicked, this, &ServicesSettingsPage::changed);
+#ifndef Q_OS_WIN
auto *downloadButton = new KNS3::Button(i18nc("@action:button", "Download New Services..."),
QStringLiteral("servicemenu.knsrc"),
this);
- connect(downloadButton, &KNS3::Button::dialogFinished, this, &ServicesSettingsPage::loadServices);
+ connect(downloadButton, &KNS3::Button::dialogFinished, this, [this](const KNS3::Entry::List &changedEntries) {
+ if (!changedEntries.isEmpty()) {
+ m_serviceModel->clear();
+ loadServices();
+ }
+ });
+
+#endif
topLayout->addWidget(label);
topLayout->addWidget(m_searchLineEdit);
topLayout->addWidget(m_listView);
+#ifndef Q_OS_WIN
topLayout->addWidget(downloadButton);
+#endif
m_enabledVcsPlugins = VersionControlSettings::enabledPlugins();
std::sort(m_enabledVcsPlugins.begin(), m_enabledVcsPlugins.end());
diff --git a/src/settings/services/servicessettingspage.h b/src/settings/services/servicessettingspage.h
index 8f507407b..b569852ae 100644
--- a/src/settings/services/servicessettingspage.h
+++ b/src/settings/services/servicessettingspage.h
@@ -1,21 +1,8 @@
-/***************************************************************************
- * Copyright (C) 2009-2010 by Peter Penz <[email protected]> *
- * *
- * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2009-2010 Peter Penz <[email protected]>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
#ifndef SERVICESSETTINGSPAGE_H
#define SERVICESSETTINGSPAGE_H
diff --git a/src/settings/services/test/service_menu_deinstallation_test.rb b/src/settings/services/test/service_menu_deinstallation_test.rb
index 4017e8ee0..bf44b7b7f 100644
--- a/src/settings/services/test/service_menu_deinstallation_test.rb
+++ b/src/settings/services/test/service_menu_deinstallation_test.rb
@@ -1,21 +1,8 @@
#!/usr/bin/env ruby
-# Copyright (C) 2019 Harald Sitter <[email protected]>
+# SPDX-FileCopyrightText: 2019 Harald Sitter <[email protected]>
#
-# 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+# SPDX-License-Identifier: GPL-2.0-or-later
require_relative 'test_helper'
diff --git a/src/settings/services/test/service_menu_installation_test.rb b/src/settings/services/test/service_menu_installation_test.rb
index 01bf65b23..7c05a40e3 100644
--- a/src/settings/services/test/service_menu_installation_test.rb
+++ b/src/settings/services/test/service_menu_installation_test.rb
@@ -1,21 +1,8 @@
#!/usr/bin/env ruby
-# Copyright (C) 2019 Harald Sitter <[email protected]>
+# SPDX-FileCopyrightText: 2019 Harald Sitter <[email protected]>
#
-# 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+# SPDX-License-Identifier: GPL-2.0-or-later
require_relative 'test_helper'
diff --git a/src/settings/services/test/test_helper.rb b/src/settings/services/test/test_helper.rb
index 35b5d19eb..b4e4dded2 100644
--- a/src/settings/services/test/test_helper.rb
+++ b/src/settings/services/test/test_helper.rb
@@ -1,19 +1,6 @@
-# Copyright (C) 2019 Harald Sitter <[email protected]>
+# SPDX-FileCopyrightText: 2019 Harald Sitter <[email protected]>
#
-# 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+# SPDX-License-Identifier: GPL-2.0-or-later
$LOAD_PATH.unshift(File.absolute_path('../', __dir__)) # ../
diff --git a/src/settings/services/test/test_run.rb b/src/settings/services/test/test_run.rb
index b2149bbe0..ab298a0b0 100755
--- a/src/settings/services/test/test_run.rb
+++ b/src/settings/services/test/test_run.rb
@@ -1,21 +1,8 @@
#!/usr/bin/env ruby
-# Copyright (C) 2019 Harald Sitter <[email protected]>
+# SPDX-FileCopyrightText: 2019 Harald Sitter <[email protected]>
#
-# 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
+# SPDX-License-Identifier: GPL-2.0-or-later
# This is a fancy wrapper around test_helper to prevent the collector from
# loading the helper twice as it would occur if we ran the helper directly.