X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b6700f77dd8e07fdab0d40ea4bc91f8d0c03ae70..d2f044b32d34023fbf4755b95dcafe71ed00b55f:/src/settings/services/servicessettingspage.cpp 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 * - * * - * 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 + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "servicessettingspage.h" @@ -31,11 +18,12 @@ #include #include #include -#include +#include #include #include #include +#include #include #include #include @@ -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());