diff options
Diffstat (limited to 'src/settings/services/servicessettingspage.cpp')
| -rw-r--r-- | src/settings/services/servicessettingspage.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp index e18bfb09e..6ce5e1fc9 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,7 +18,7 @@ #include <KPluginMetaData> #include <KService> #include <KServiceTypeTrader> -#include <kdesktopfileactions.h> +#include <KDesktopFileActions> #include <QGridLayout> #include <QLabel> @@ -82,15 +69,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()); |
