Hello community, here is the log from the commit of package filelight for openSUSE:Factory checked in at 2016-08-31 00:06:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/filelight (Old) and /work/SRC/openSUSE:Factory/.filelight.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "filelight" Changes: -------- --- /work/SRC/openSUSE:Factory/filelight/filelight.changes 2016-07-24 19:44:27.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.filelight.new/filelight.changes 2016-08-31 00:06:23.000000000 +0200 @@ -1,0 +2,16 @@ +Fri Aug 12 10:03:05 UTC 2016 - [email protected] + +- Update to KDE Applications 16.08.0 + * KDE Applications 16.08.0 + * https://www.kde.org/announcements/announce-applications-16.08.0.php + + +------------------------------------------------------------------- +Mon Aug 8 14:34:52 UTC 2016 - [email protected] + +- Update to KDE Applications 16.07.90 + * KDE Applications 16.07.90 (16.08-RC) + * https://www.kde.org/announcements/announce-applications-16.07.90.php + + +------------------------------------------------------------------- Old: ---- filelight-16.04.3.tar.xz New: ---- filelight-16.08.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ filelight.spec ++++++ --- /var/tmp/diff_new_pack.c8MNnW/_old 2016-08-31 00:06:24.000000000 +0200 +++ /var/tmp/diff_new_pack.c8MNnW/_new 2016-08-31 00:06:24.000000000 +0200 @@ -17,7 +17,7 @@ Name: filelight -Version: 16.04.3 +Version: 16.08.0 Release: 0 Summary: Graphical disk usage viewer License: GPL-2.0 or GPL-3.0 ++++++ filelight-16.04.3.tar.xz -> filelight-16.08.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/CMakeLists.txt new/filelight-16.08.0/CMakeLists.txt --- old/filelight-16.04.3/CMakeLists.txt 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/CMakeLists.txt 2016-07-02 15:21:38.000000000 +0200 @@ -36,13 +36,12 @@ include(KDECompilerSettings NO_POLICY_SCOPE) -find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets) +find_package(Qt5 5.4 CONFIG REQUIRED Core Widgets) find_package(KF5 REQUIRED - KIO + XmlGui # For app + KIO # For part + Solid # For part Parts - Solid - XmlGui - CoreAddons DocTools I18n ) @@ -52,6 +51,7 @@ -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII + -DQT_NO_URL_CAST_FROM_STRING ) add_definitions(-DTRANSLATION_DOMAIN=\"filelight\") Files old/filelight-16.04.3/doc/config_appear.png and new/filelight-16.08.0/doc/config_appear.png differ Files old/filelight-16.04.3/doc/config_scan.png and new/filelight-16.08.0/doc/config_scan.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/doc/index.docbook new/filelight-16.08.0/doc/index.docbook --- old/filelight-16.04.3/doc/index.docbook 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/doc/index.docbook 2016-07-02 15:21:38.000000000 +0200 @@ -1,7 +1,5 @@ <?xml version="1.0" ?> <!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [ - <!ENTITY package "kdeutils"> - <!ENTITY kappname "&filelight;"> <!ENTITY filelight "<application>Filelight</application>"> <!ENTITY % addindex "IGNORE"> <!ENTITY % English "INCLUDE"><!-- change language only here --> @@ -28,8 +26,8 @@ <copyright><year>2009</year><holder>Martin Sandsmark</holder></copyright> <!-- Translators: put here the copyright notice of the translation --> <legalnotice>&FDLNotice;</legalnotice> - <date>2013-05-25</date> - <releaseinfo>1.20 (&kde; 4.11)</releaseinfo> + <date>2015-08-04</date> + <releaseinfo>&filelight; 1.21 (Applications 15.08)</releaseinfo> <abstract><para>&filelight; creates an interactive map of concentric segmented-rings that helps visualize disk usage on your computer.</para></abstract> <!-- These may be used by search engines --> <keywordset> @@ -50,7 +48,7 @@ <textobject><phrase>Screenshot</phrase></textobject> </mediaobject> </screenshot> - <para>&filelight; allows you to quickly understand exactly where your diskspace is being used by graphically representing your file system as a set of concentric segmented-rings. You can use it to locate hotspots of disk usage and then manipulate those areas using &konqueror;.</para> + <para>&filelight; allows you to quickly understand exactly where your diskspace is being used by graphically representing your file system as a set of concentric segmented-rings. You can use it to locate hotspots of disk usage and then manipulate those areas using &dolphin; or &konqueror;.</para> </chapter> @@ -103,14 +101,12 @@ <sect1 id="starting"> <title>Starting &filelight;</title> -<para>&filelight; can be started from the K-Menu, or from the command-line</para> +<para>&filelight; can be started from the application launcher, or from the command-line</para> <sect2 id="starting-from-the-menu"> -<title>From the K-Menu</title> +<title>From the Application Launcher</title> <para> -Open the &kde; program menu by clicking on the -<guiicon>big K</guiicon> icon on your -panel. This will raise the <guimenu>program menu</guimenu>. Move your +Open the application menu and move your cursor up the menu to the <guimenu>Utilities</guimenu> menu item. Choose <guimenuitem>&filelight;</guimenuitem>. </para> @@ -170,7 +166,6 @@ </menuchoice></term> <listitem><para><action>Offers a folder selection dialog so you can choose a folder to scan.</action></para></listitem> </varlistentry> -<!--FIXME shortcut not visible in the menu, why?--> <varlistentry> <term><menuchoice> <shortcut> @@ -190,15 +185,6 @@ <listitem><para><action>Starts a scan of the root folder.</action></para></listitem> </varlistentry> -<!--not in 4.11 -varlistentry> -<term><menuchoice> -<guimenu>Scan</guimenu> -<guimenuitem>Recent Scans</guimenuitem> -</menuchoice></term> -<listitem><para><action>Provides a list of your most recent scanned folders allowing quick access to these folders.</action></para></listitem> -</varlistentry--> - <varlistentry> <term><menuchoice> <shortcut> @@ -276,11 +262,6 @@ <varlistentry> <term><menuchoice> -<!-- -<shortcut> -<keycombo action="simul">&Alt;<keycap>Left</keycap></keycombo> -</shortcut> ---> <guimenu>Go</guimenu> <guimenuitem>Back</guimenuitem> </menuchoice></term> @@ -289,11 +270,6 @@ <varlistentry> <term><menuchoice> -<!-- -<shortcut> -<keycombo action="simul">&Alt;<keycap>Right</keycap></keycombo> -</shortcut> ---> <guimenu>Go</guimenu> <guimenuitem>Forward</guimenuitem> </menuchoice></term> @@ -327,21 +303,6 @@ </sect1> </chapter> - -<appendix id="installation"> - <title>Installation</title> - - <sect1 id="getting-kapp"> - <title>How to obtain &filelight;</title> - &install.intro.documentation; - </sect1> - - <sect1 id="Compilation"> - <title>Compilation and Installation</title> - &install.compile.documentation; - </sect1> -</appendix> - &documentation.index; </book> Files old/filelight-16.04.3/doc/radial_map.png and new/filelight-16.08.0/doc/radial_map.png differ Files old/filelight-16.04.3/doc/radial_map_context_menu.png and new/filelight-16.08.0/doc/radial_map_context_menu.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/misc/org.kde.filelight.desktop new/filelight-16.08.0/misc/org.kde.filelight.desktop --- old/filelight-16.04.3/misc/org.kde.filelight.desktop 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/misc/org.kde.filelight.desktop 2016-07-02 15:21:38.000000000 +0200 @@ -70,6 +70,7 @@ GenericName[fr]=Statistiques d'utilisation de disques GenericName[ga]=Staitisticí maidir le húsáid diosca GenericName[gl]=Estatísticas de uso do disco +GenericName[he]=סטטיסטיקות שימוש בכונן GenericName[hr]=Statistika o upotrebi diska GenericName[hu]=Lemezhasználati statisztika GenericName[ia]=Statisticas de uso de disco diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/app/CMakeLists.txt new/filelight-16.08.0/src/app/CMakeLists.txt --- old/filelight-16.04.3/src/app/CMakeLists.txt 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/app/CMakeLists.txt 2016-07-02 15:21:38.000000000 +0200 @@ -22,6 +22,9 @@ add_executable(filelight ${filelight_SRCS}) -target_link_libraries(filelight KF5::Parts KF5::XmlGui KF5::KIOWidgets KF5::CoreAddons) +target_link_libraries(filelight + KF5::Parts + KF5::XmlGui +) install(TARGETS filelight ${INSTALL_TARGETS_DEFAULT_ARGS}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/app/historyAction.cpp new/filelight-16.08.0/src/app/historyAction.cpp --- old/filelight-16.04.3/src/app/historyAction.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/app/historyAction.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -80,8 +80,8 @@ { ac->addAction(QLatin1String( "go_back" ), m_b); ac->addAction(QLatin1String( "go_forward" ), m_f); - connect(m_b, SIGNAL(triggered(bool)), SLOT(pop())); - connect(m_f, SIGNAL(triggered(bool)), SLOT(pop())); + connect(m_b, &QAction::triggered, this, &HistoryCollection::pop); + connect(m_f, &QAction::triggered, this, &HistoryCollection::pop); } void HistoryCollection::push(const QUrl& url) //slot @@ -94,7 +94,7 @@ m_receiver = m_b; } - m_receiver->push(url.path()); + m_receiver->push(url); } m_receiver = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/app/historyAction.h new/filelight-16.08.0/src/app/historyAction.h --- old/filelight-16.04.3/src/app/historyAction.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/app/historyAction.h 2016-07-02 15:21:38.000000000 +0200 @@ -31,6 +31,8 @@ class HistoryAction : QAction { + Q_OBJECT + HistoryAction(const QIcon &icon, const QString &text, KActionCollection *ac); friend class HistoryCollection; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/app/main.cpp new/filelight-16.08.0/src/app/main.cpp --- old/filelight-16.04.3/src/app/main.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/app/main.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -70,6 +70,7 @@ app.setApplicationVersion(QStringLiteral(APP_VERSION)); app.setOrganizationDomain(QStringLiteral("kde.org")); app.setOrganizationName(QStringLiteral("KDE")); + app.setWindowIcon(QIcon::fromTheme(QLatin1String(APP_NAME))); KAboutData::setApplicationData(about); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/app/mainWindow.cpp new/filelight-16.08.0/src/app/mainWindow.cpp --- old/filelight-16.04.3/src/app/mainWindow.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/app/mainWindow.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -50,6 +50,7 @@ #include <KStandardAction> #include <KActionCollection> #include <KIO/Global> // upUrl +#include <KIO/Job> // Connection of the Part::started signal #include <KService> #include <KLocalizedString> @@ -83,12 +84,12 @@ stateChanged(QStringLiteral( "scan_failed" )); //bah! doesn't affect the parts' actions, should I add them to the actionCollection here? - connect(m_part, SIGNAL(started(KIO::Job*)), SLOT(scanStarted())); - connect(m_part, SIGNAL(completed()), SLOT(scanCompleted())); - connect(m_part, SIGNAL(canceled(QString)), SLOT(scanFailed())); + connect(m_part, &KParts::ReadOnlyPart::started, this, &MainWindow::scanStarted); + connect(m_part, static_cast<void (KParts::ReadOnlyPart::*)()>(&KParts::ReadOnlyPart::completed), this, &MainWindow::scanCompleted); + connect(m_part, &KParts::ReadOnlyPart::canceled, this, &MainWindow::scanFailed); - connect(m_part, SIGNAL(canceled(QString)), m_histories, SLOT(stop())); - connect(BrowserExtension::childObject(m_part), SIGNAL(openUrlNotify()), SLOT(urlAboutToChange())); + connect(m_part, &KParts::ReadOnlyPart::canceled, m_histories, &HistoryCollection::stop); + connect(BrowserExtension::childObject(m_part), &KParts::BrowserExtension::openUrlNotify, this, &MainWindow::urlAboutToChange); const KConfigGroup config = KSharedConfig::openConfig()->group("general"); m_combo->setHistoryItems(config.readPathEntry("comboHistory", QStringList())); @@ -157,9 +158,9 @@ m_recentScans->loadEntries(KSharedConfig::openConfig()->group("general")); - connect(m_recentScans, SIGNAL(urlSelected(QUrl)), SLOT(slotScanUrl(QUrl))); - connect(m_combo, SIGNAL(returnPressed()), SLOT(slotComboScan())); - connect(m_histories, SIGNAL(activated(QUrl)), SLOT(slotScanUrl(QUrl))); + connect(m_recentScans, &KRecentFilesAction::urlSelected, this, &MainWindow::slotScanUrl); + connect(m_combo, static_cast<void (KHistoryComboBox::*)()>(&KHistoryComboBox::returnPressed), this, &MainWindow::slotComboScan); + connect(m_histories, &HistoryCollection::activated, this, &MainWindow::slotScanUrl); } void MainWindow::closeEvent(QCloseEvent *event) @@ -270,8 +271,8 @@ action("go_up")->setToolTip(QString()); } else { - action("go_up")->setStatusTip(KIO::upUrl(url).toString()); - action("go_up")->setToolTip(KIO::upUrl(url).toString()); + action("go_up")->setStatusTip(KIO::upUrl(url).path()); + action("go_up")->setToolTip(KIO::upUrl(url).path()); } m_recentScans->addUrl(url); //FIXME doesn't set the tick diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/CMakeLists.txt new/filelight-16.08.0/src/part/CMakeLists.txt --- old/filelight-16.04.3/src/part/CMakeLists.txt 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/CMakeLists.txt 2016-07-02 15:21:38.000000000 +0200 @@ -38,6 +38,10 @@ add_library(filelightpart MODULE ${filelight_PART_SRCS}) -target_link_libraries(filelightpart KF5::Parts KF5::KIOCore KF5::KIOWidgets KF5::Solid KF5::CoreAddons KF5::Service) +target_link_libraries(filelightpart + KF5::Parts + KF5::KIOCore + KF5::Solid +) install(TARGETS filelightpart DESTINATION ${PLUGIN_INSTALL_DIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/Config.cpp new/filelight-16.08.0/src/part/Config.cpp --- old/filelight-16.04.3/src/part/Config.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/Config.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -34,7 +34,7 @@ bool Config::showSmallFiles; bool Config::antialias; uint Config::contrast; -uint Config::minFontPitch; +int Config::minFontPitch; uint Config::defaultRingDepth; Filelight::MapScheme Config::scheme; QStringList Config::skipList; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/Config.h new/filelight-16.08.0/src/part/Config.h --- old/filelight-16.04.3/src/part/Config.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/Config.h 2016-07-02 15:21:38.000000000 +0200 @@ -47,7 +47,7 @@ static bool showSmallFiles; static uint contrast; static bool antialias; - static uint minFontPitch; + static int minFontPitch; static uint defaultRingDepth; static MapScheme scheme; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/localLister.cpp new/filelight-16.08.0/src/part/localLister.cpp --- old/filelight-16.04.3/src/part/localLister.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/localLister.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -90,7 +90,7 @@ tree = 0; } qDebug() << "Emitting signal to cache results ..."; - emit branchCompleted(tree, true); + emit branchCompleted(tree); qDebug() << "Thread terminating ..."; } @@ -241,13 +241,16 @@ partition = device.as<Solid::StorageAccess>(); if (!partition->isAccessible() || partition->filePath() == QLatin1String( "/" ) || partition->filePath().isEmpty()) continue; + QString filePath = partition->filePath(); + if (!filePath.endsWith(QLatin1String("/"))) + filePath.append(QLatin1String("/")); volume = device.as<Solid::StorageVolume>(); if (remoteFsTypes.contains(volume->fsType())) { - if (!s_remoteMounts.contains(partition->filePath())) { - s_remoteMounts.append(partition->filePath()); + if (!s_remoteMounts.contains(filePath)) { + s_remoteMounts.append(filePath); } - } else if (!s_localMounts.contains(partition->filePath())) { - s_localMounts.append(partition->filePath()); + } else if (!s_localMounts.contains(filePath)) { + s_localMounts.append(filePath); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/localLister.h new/filelight-16.08.0/src/part/localLister.h --- old/filelight-16.04.3/src/part/localLister.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/localLister.h 2016-07-02 15:21:38.000000000 +0200 @@ -42,7 +42,7 @@ static void readMounts(); signals: - void branchCompleted(Folder* tree, bool finished); + void branchCompleted(Folder* tree); private: QString m_path; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/part.cpp new/filelight-16.08.0/src/part/part.cpp --- old/filelight-16.04.3/src/part/part.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/part.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -78,7 +78,6 @@ QString(), QStringLiteral("http://utils.kde.org/projects/filelight"), QStringLiteral("[email protected]")); - aboutData.setProgramIconName(QStringLiteral(APP_NAME)); setComponentData(aboutData); setXMLFile(QStringLiteral( "filelightpartui.rc" )); @@ -113,18 +112,18 @@ QAction *action = actionCollection()->addAction(QStringLiteral("configure_filelight")); action->setText(i18n("Configure Filelight...")); action->setIcon(QIcon::fromTheme(QStringLiteral("configure"))); - connect(action, SIGNAL(triggered()), this, SLOT(configFilelight())); + connect(action, &QAction::triggered, this, &Part::configFilelight); - connect(m_map, SIGNAL(created(const Folder*)), SIGNAL(completed())); - connect(m_map, SIGNAL(created(const Folder*)), SLOT(mapChanged(const Folder*))); - connect(m_map, SIGNAL(activated(QUrl)), SLOT(updateURL(QUrl))); + connect(m_map, &RadialMap::Widget::folderCreated, this, static_cast<void (Part::*)()>(&Part::completed)); + connect(m_map, &RadialMap::Widget::folderCreated, this, &Part::mapChanged); + connect(m_map, &RadialMap::Widget::activated, this, &Part::updateURL); // TODO make better system - connect(m_map, SIGNAL(giveMeTreeFor(QUrl)), SLOT(updateURL(QUrl))); - connect(m_map, SIGNAL(giveMeTreeFor(QUrl)), SLOT(openUrl(QUrl))); + connect(m_map, &RadialMap::Widget::giveMeTreeFor, this, &Part::updateURL); + connect(m_map, &RadialMap::Widget::giveMeTreeFor, this, &Part::openUrl); - connect(m_manager, SIGNAL(completed(Folder*)), SLOT(scanCompleted(Folder*))); - connect(m_manager, SIGNAL(aboutToEmptyCache()), m_map, SLOT(invalidate())); + connect(m_manager, &ScanManager::completed, this, &Part::scanCompleted); + connect(m_manager, &ScanManager::aboutToEmptyCache, m_map, &RadialMap::Widget::invalidate); QTimer::singleShot(0, this, SLOT(postInit())); } @@ -227,10 +226,10 @@ void Part::configFilelight() { - QWidget *dialog = new SettingsDialog(widget()); + SettingsDialog *dialog = new SettingsDialog(widget()); - connect(dialog, SIGNAL(canvasIsDirty(int)), m_map, SLOT(refresh(int))); - connect(dialog, SIGNAL(mapIsInvalid()), m_manager, SLOT(emptyCache())); + connect(dialog, &SettingsDialog::canvasIsDirty, m_map, &RadialMap::Widget::refresh); + connect(dialog, &SettingsDialog::mapIsInvalid, m_manager, &ScanManager::emptyCache); dialog->show(); //deletes itself } @@ -240,7 +239,7 @@ { if (!m_started) { connect(m_map, SIGNAL(mouseHover(QString)), statusBar(), SLOT(showMessage(const QString&))); - connect(m_map, SIGNAL(created(const Folder*)), statusBar(), SLOT(clearMessage())); + connect(m_map, &RadialMap::Widget::folderCreated, statusBar(), &QStatusBar::clearMessage); m_started = true; } @@ -303,6 +302,11 @@ statusBar()->clearMessage(); + m_map->hide(); + m_stateWidget->hide(); + + showSummary(); + setUrl(QUrl()); } } @@ -328,7 +332,7 @@ if (m_summary == 0) { m_summary = new SummaryWidget(widget()); m_summary->setObjectName(QStringLiteral( "summaryWidget" )); - connect(m_summary, SIGNAL(activated(QUrl)), SLOT(openUrl(QUrl))); + connect(m_summary, &SummaryWidget::activated, this, &Part::openUrl); m_summary->show(); m_layout->addWidget(m_summary); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/part.h new/filelight-16.08.0/src/part/part.h --- old/filelight-16.04.3/src/part/part.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/part.h 2016-07-02 15:21:38.000000000 +0200 @@ -39,9 +39,12 @@ namespace Filelight { class Part; +class SummaryWidget; class BrowserExtension : public KParts::BrowserExtension { + Q_OBJECT + public: explicit BrowserExtension(Part*); }; @@ -80,7 +83,7 @@ void showSummary(); QLayout *m_layout; - QWidget *m_summary; + SummaryWidget *m_summary; BrowserExtension *m_ext; StatusBarExtension *m_statusbar; RadialMap::Widget *m_map; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/progressBox.cpp new/filelight-16.08.0/src/part/progressBox.cpp --- old/filelight-16.04.3/src/part/progressBox.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/progressBox.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -22,6 +22,7 @@ #include "progressBox.h" #include "scan.h" +#include "part.h" #include <KColorScheme> #include <KIO/Job> @@ -36,9 +37,9 @@ #include <math.h> -ProgressBox::ProgressBox(QWidget *parent, QObject *part, Filelight::ScanManager *m) +ProgressBox::ProgressBox(QWidget *parent, Filelight::Part *part, Filelight::ScanManager *scanManager) : QWidget(parent) - , m_manager(m) + , m_manager(scanManager) { hide(); @@ -51,10 +52,10 @@ setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setMinimumSize(200, 200); - connect(&m_timer, SIGNAL(timeout()), SLOT(report())); - connect(part, SIGNAL(started(KIO::Job*)), SLOT(start())); - connect(part, SIGNAL(completed()), SLOT(stop())); - connect(part, SIGNAL(canceled(QString)), SLOT(halt())); + connect(&m_timer, &QTimer::timeout, this, &ProgressBox::report); + connect(part, &Filelight::Part::started, this, &ProgressBox::start); + connect(part, static_cast<void (Filelight::Part::*)()>(&Filelight::Part::completed), this, &ProgressBox::stop); + connect(part, &Filelight::Part::canceled, this, &ProgressBox::halt); } void @@ -97,7 +98,6 @@ #define PIECES_NUM 4 static const float angleFactor[] = { -0.75, 0.5, 1.0, -0.3 }; static const int length[] = { 30, 40, 50, 60 }; -static const int angleOffset[] = { 5760, 0, 0, -5760 }; static const int aLength[] = { 300, 2000, 200, 2000 }; void ProgressBox::paintEvent(QPaintEvent*) @@ -123,9 +123,10 @@ paint.setBrush(view.background(KColorScheme::ActiveBackground)); paint.setPen(view.foreground().color()); paint.translate(0.5, 0.5); - paint.drawRoundedRect(95-m_textWidth/2, 85, m_textWidth+10, m_textHeight+10, 5, 5); + QRectF textRect(100 - m_textWidth/2 - 5, 100 - m_textHeight - 5, m_textWidth + 10, m_textHeight + 10); + paint.drawRoundedRect(textRect, 5, 5); paint.translate(-0.5, -0.5); - paint.drawText(100 - m_textWidth/2, 100, m_text); + paint.drawText(textRect, Qt::AlignCenter, m_text); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/progressBox.h new/filelight-16.08.0/src/part/progressBox.h --- old/filelight-16.04.3/src/part/progressBox.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/progressBox.h 2016-07-02 15:21:38.000000000 +0200 @@ -27,6 +27,7 @@ namespace Filelight { class ScanManager; +class Part; } class ProgressBox : public QWidget @@ -34,7 +35,7 @@ Q_OBJECT public: - ProgressBox(QWidget*, QObject*, Filelight::ScanManager*); + ProgressBox(QWidget *parent, Filelight::Part *part, Filelight::ScanManager *scanManager); void setText(int); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/radialMap/widget.cpp new/filelight-16.08.0/src/part/radialMap/widget.cpp --- old/filelight-16.04.3/src/part/radialMap/widget.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/radialMap/widget.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -48,9 +48,8 @@ setAcceptDrops(true); setMinimumSize(350, 250); - connect(this, SIGNAL(created(const Folder*)), SLOT(sendFakeMouseEvent())); - connect(this, SIGNAL(created(const Folder*)), SLOT(update())); - connect(&m_timer, SIGNAL(timeout()), SLOT(resizeTimeout())); + connect(this, &Widget::folderCreated, this, &Widget::sendFakeMouseEvent); + connect(&m_timer, &QTimer::timeout, this, &Widget::resizeTimeout); } RadialMap::Widget::~Widget() @@ -119,7 +118,7 @@ m_tree = tree; //tell rest of Filelight - emit created(tree); + emit folderCreated(tree); } void @@ -135,6 +134,7 @@ { QMouseEvent me(QEvent::MouseMove, mapFromGlobal(QCursor::pos()), Qt::NoButton, Qt::NoButton, Qt::NoModifier); QApplication::sendEvent(this, &me); + update(); } void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/radialMap/widget.h new/filelight-16.08.0/src/part/radialMap/widget.h --- old/filelight-16.04.3/src/part/radialMap/widget.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/radialMap/widget.h 2016-07-02 15:21:38.000000000 +0200 @@ -82,7 +82,7 @@ signals: void activated(const QUrl&); void invalidated(const QUrl&); - void created(const Folder*); + void folderCreated(const Folder*); void mouseHover(const QString&); void giveMeTreeFor(const QUrl&); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/radialMap/widgetEvents.cpp new/filelight-16.08.0/src/part/radialMap/widgetEvents.cpp --- old/filelight-16.04.3/src/part/radialMap/widgetEvents.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/radialMap/widgetEvents.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -199,98 +199,104 @@ //m_focus is set correctly (I've been strict, I assure you it is correct!) - if (m_focus && !m_focus->isFake()) - { - const QUrl url = Widget::url(m_focus->file()); - const bool isDir = m_focus->file()->isFolder(); - - // Actions in the right click menu - QAction* openFileManager = 0; - QAction* openTerminal = 0; - QAction* centerMap = 0; - QAction* openFile = 0; - QAction* copyClipboard = 0; - QAction* deleteItem = 0; - - if (e->button() == Qt::RightButton) - { - QMenu popup; - popup.setTitle(m_focus->file()->fullPath(m_tree)); - - if (isDir) { - openFileManager = popup.addAction(QIcon::fromTheme(QLatin1String("system-file-manager")), i18n("Open &File Manager Here")); - - if (url.scheme() == QLatin1String("file" )) - openTerminal = popup.addAction(QIcon::fromTheme(QLatin1String( "utilities-terminal" )), i18n("Open &Terminal Here")); - - if (m_focus->file() != m_tree) { - popup.addSeparator(); - centerMap = popup.addAction(QIcon::fromTheme(QLatin1String( "zoom-in" )), i18n("&Center Map Here")); - } - } - else - openFile = popup.addAction(QIcon::fromTheme(QLatin1String("document-open")), i18nc("Scan/open the path of the selected element", "&Open")); + if (!m_focus || m_focus->isFake()) { + return; + } - popup.addSeparator(); - copyClipboard = popup.addAction(QIcon::fromTheme(QLatin1String( "edit-copy" )), i18n("&Copy to clipboard")); + const QUrl url = Widget::url(m_focus->file()); + const bool isDir = m_focus->file()->isFolder(); + + // Open file + if (e->button() == Qt::MidButton || (e->button() == Qt::LeftButton && !isDir)) { + new KRun(url, this, true); - if (m_focus->file() != m_tree) { - popup.addSeparator(); - deleteItem = popup.addAction(QIcon::fromTheme(QLatin1String( "edit-delete" )), i18n("&Delete")); - } - - QAction* clicked = popup.exec(e->globalPos(), 0); - - if (openFileManager && clicked == openFileManager) { - KRun::runUrl(url.url(),QLatin1String( "inode/directory" ), this); - } else if (openTerminal && clicked == openTerminal) { - KToolInvocation::invokeTerminal(QString(),url.path()); - } else if (centerMap && clicked == centerMap) { - goto section_two; - } else if (openFile && clicked == openFile) { - goto section_two; - } else if (clicked == copyClipboard) { - QMimeData* mimedata = new QMimeData(); - mimedata->setUrls(QList<QUrl>() << url); - QApplication::clipboard()->setMimeData(mimedata , QClipboard::Clipboard); - } else if (clicked == deleteItem && m_focus->file() != m_tree) { - m_toBeDeleted = m_focus; - const QUrl url = Widget::url(m_toBeDeleted->file()); - const QString message = m_toBeDeleted->file()->isFolder() - ? i18n("<qt>The folder at <i>'%1'</i> will be <b>recursively</b> and <b>permanently</b> deleted.</qt>", url.toString()) - : i18n("<qt><i>'%1'</i> will be <b>permanently</b> deleted.</qt>", url.toString()); - const int userIntention = KMessageBox::warningContinueCancel( - this, message, - QString(), KGuiItem(i18n("&Delete"), QLatin1String("edit-delete"))); - - if (userIntention == KMessageBox::Continue) { - KIO::Job *job = KIO::del(url); - connect(job, SIGNAL(finished(KJob*)), this, SLOT(deleteJobFinished(KJob*))); - QApplication::setOverrideCursor(Qt::BusyCursor); - setEnabled(false); - } - } else { - //ensure m_focus is set for new mouse position - sendFakeMouseEvent(); - } + return; + } + + if (e->button() == Qt::LeftButton) { + if (m_focus->file() != m_tree) { + emit activated(url); //activate first, this will cause UI to prepare itself + createFromCache((Folder *)m_focus->file()); + } else if (KIO::upUrl(url) != url) { + emit giveMeTreeFor(KIO::upUrl(url)); } - else { // not right mouse button -section_two: - const QRect rect(e->x() - 20, e->y() - 20, 40, 40); + return; + } + + if (e->button() != Qt::RightButton) { + // Ignore other mouse buttons + return; + } + + // Actions in the right click menu + QAction* openFileManager = 0; + QAction* openTerminal = 0; + QAction* centerMap = 0; + QAction* openFile = 0; + QAction* copyClipboard = 0; + QAction* deleteItem = 0; + + QMenu popup; + popup.setTitle(m_focus->file()->fullPath(m_tree)); + + if (isDir) { + openFileManager = popup.addAction(QIcon::fromTheme(QLatin1String("system-file-manager")), i18n("Open &File Manager Here")); + + if (url.scheme() == QLatin1String("file")) { + openTerminal = popup.addAction(QIcon::fromTheme(QLatin1String( "utilities-terminal" )), i18n("Open &Terminal Here")); + } + + if (m_focus->file() != m_tree) { + popup.addSeparator(); + centerMap = popup.addAction(QIcon::fromTheme(QLatin1String( "zoom-in" )), i18n("&Center Map Here")); + } + } else { + openFile = popup.addAction(QIcon::fromTheme(QLatin1String("document-open")), i18nc("Scan/open the path of the selected element", "&Open")); + } + + popup.addSeparator(); + copyClipboard = popup.addAction(QIcon::fromTheme(QLatin1String( "edit-copy" )), i18n("&Copy to clipboard")); + + if (m_focus->file() != m_tree) { + popup.addSeparator(); + deleteItem = popup.addAction(QIcon::fromTheme(QLatin1String( "edit-delete" )), i18n("&Delete")); + } + + QAction* clicked = popup.exec(e->globalPos(), 0); - if (!isDir || e->button() == Qt::MidButton) { - // KIconEffect::visualActivate(this, rect); // TODO: recreate this - new KRun(url, this, true); //FIXME see above - } - else if (m_focus->file() != m_tree) { // is left click - // KIconEffect::visualActivate(this, rect); // TODO: recreate this - emit activated(url); //activate first, this will cause UI to prepare itself - createFromCache((Folder *)m_focus->file()); - } - else if (KIO::upUrl(url) != url) - emit giveMeTreeFor(KIO::upUrl(url)); + if (openFileManager && clicked == openFileManager) { + KRun::runUrl(url, QLatin1String( "inode/directory" ), this); + } else if (openTerminal && clicked == openTerminal) { + KToolInvocation::invokeTerminal(QString(),url.path()); + } else if (centerMap && clicked == centerMap) { + emit activated(url); //activate first, this will cause UI to prepare itself + createFromCache((Folder *)m_focus->file()); + } else if (openFile && clicked == openFile) { + new KRun(url, this, true); + } else if (clicked == copyClipboard) { + QMimeData* mimedata = new QMimeData(); + mimedata->setUrls(QList<QUrl>() << url); + QApplication::clipboard()->setMimeData(mimedata , QClipboard::Clipboard); + } else if (clicked == deleteItem && m_focus->file() != m_tree) { + m_toBeDeleted = m_focus; + const QUrl url = Widget::url(m_toBeDeleted->file()); + const QString message = m_toBeDeleted->file()->isFolder() + ? i18n("<qt>The folder at <i>'%1'</i> will be <b>recursively</b> and <b>permanently</b> deleted.</qt>", url.toString()) + : i18n("<qt><i>'%1'</i> will be <b>permanently</b> deleted.</qt>", url.toString()); + const int userIntention = KMessageBox::warningContinueCancel( + this, message, + QString(), KGuiItem(i18n("&Delete"), QLatin1String("edit-delete"))); + + if (userIntention == KMessageBox::Continue) { + KIO::Job *job = KIO::del(url); + connect(job, &KJob::finished, this, &RadialMap::Widget::deleteJobFinished); + QApplication::setOverrideCursor(Qt::BusyCursor); + setEnabled(false); } + } else { + //ensure m_focus is set for new mouse position + sendFakeMouseEvent(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/remoteLister.cpp new/filelight-16.08.0/src/part/remoteLister.cpp --- old/filelight-16.04.3/src/part/remoteLister.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/remoteLister.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -44,22 +44,21 @@ /// location of the folder const QUrl url; /// the folder on which we are operating - Folder *folder; + Folder *folder = nullptr; /// so we can reference the parent store - Store *parent; + Store *parent = nullptr; /// directories in this folder that need to be scanned before we can propagate() List stores; - Store() : folder(0), parent(0) {} Store(const QUrl &u, const QString &name, Store *s) - : url(u), folder(new Folder(name.toUtf8() + '/')), parent(s) {} + : url(u), folder(new Folder(name.toUtf8() + '/')), parent(s) { } Store* propagate() { /// returns the next store available for scanning - qDebug() << "propagate: " << url << endl; + qDebug() << "propagate: " << url; if (parent) { parent->folder->append(folder); @@ -90,37 +89,24 @@ setMainWindow(parent); // Use SIGNAL(result(KIO::Job*)) instead and then use Job::error() - connect(this, SIGNAL(completed()), SLOT(completed())); - connect(this, SIGNAL(canceled()), SLOT(canceled())); + connect(this, static_cast<void (KCoreDirLister::*)()>(&KCoreDirLister::completed), this, &RemoteLister::completed); + connect(this, static_cast<void (KCoreDirLister::*)()>(&KCoreDirLister::canceled), this, &RemoteLister::canceled); } RemoteLister::~RemoteLister() { - Folder *tree = isFinished() ? m_store->folder : 0; - - emit branchCompleted(tree, false); delete m_root; } void -RemoteLister::completed() -{ - qDebug() << "completed: " << url().toString() << endl; - - // Delay the call to _completed since it can do a "delete this" - QTimer::singleShot(0, this, SLOT(_completed())); -} - -void RemoteLister::canceled() { - qDebug() << "canceled: " << url().toString() << endl; - - QTimer::singleShot(0, this, SLOT(_completed())); + qDebug() << "Canceled"; + emit branchCompleted(nullptr); + deleteLater(); } -void -RemoteLister::_completed() +void RemoteLister::completed() { //m_folder is set to the folder we should operate on @@ -136,10 +122,17 @@ } - if (m_store->stores.isEmpty()) + if (m_store->stores.isEmpty()) { //no directories to scan, so we need to append ourselves to the parent folder - //propagate() will return the next ancestor that has stores left to be scanned, or root if we are done - m_store = m_store->propagate(); + //propagate() will return the next ancestor that has stores left to be + //scanned, or root if we are done + Store *newStore = m_store->propagate(); + if (newStore != m_store) { + // We need to clean up old stores + delete m_store; + m_store = newStore; + } + } if (!m_store->stores.isEmpty()) { @@ -154,15 +147,16 @@ currentStore->stores.erase(first); //this returns _immediately_ - qDebug() << "scanning: " << url << endl; + qDebug() << "scanning: " << url; openUrl(url); } else { - qDebug() << "I think we're done\n"; + qDebug() << "I think we're done"; Q_ASSERT(m_root == m_store); + emit branchCompleted(m_store->folder); - delete this; + deleteLater(); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/remoteLister.h new/filelight-16.08.0/src/part/remoteLister.h --- old/filelight-16.04.3/src/part/remoteLister.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/remoteLister.h 2016-07-02 15:21:38.000000000 +0200 @@ -38,15 +38,14 @@ ~RemoteLister(); signals: - void branchCompleted(Folder* tree, bool finished); + void branchCompleted(Folder* tree); private slots: void completed(); - void _completed(); void canceled(); private: - class Store *m_root, *m_store; + struct Store *m_root, *m_store; ScanManager* m_manager; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/scan.cpp new/filelight-16.08.0/src/part/scan.cpp --- old/filelight-16.04.3/src/part/scan.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/scan.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -42,14 +42,13 @@ , m_cache(new Chain<Folder>) { Filelight::LocalLister::readMounts(); - connect(this, SIGNAL(branchCompleted(Folder*,bool)), this, SLOT(cacheTree(Folder*,bool)), Qt::QueuedConnection); - connect(this, SIGNAL(branchCacheHit(Folder*)), this, SLOT(foundCached(Folder*)), Qt::QueuedConnection); + connect(this, &ScanManager::branchCacheHit, this, &ScanManager::foundCached, Qt::QueuedConnection); } ScanManager::~ScanManager() { if (m_thread) { - qDebug() << "Attempting to abort scan operation..." << endl; + qDebug() << "Attempting to abort scan operation..."; m_abort = true; m_thread->wait(); } @@ -70,7 +69,7 @@ //url is guaranteed clean and safe - qDebug() << "Scan requested for: " << url << endl; + qDebug() << "Scan requested for: " << url; if (running()) { qWarning() << "Tried to launch two concurrent scans, aborting old one..."; @@ -80,14 +79,24 @@ m_files = 0; m_abort = false; - if (url.isLocalFile()) { - QString path = url.toLocalFile(); + if (!url.isLocalFile()) { + QGuiApplication::changeOverrideCursor(Qt::BusyCursor); + //will start listing straight away + Filelight::RemoteLister *remoteLister = new Filelight::RemoteLister(url, (QWidget*)parent(), this); + connect(remoteLister, &Filelight::RemoteLister::branchCompleted, this, &ScanManager::cacheTree, Qt::QueuedConnection); + remoteLister->setParent(this); + remoteLister->setObjectName(QLatin1String( "remote_lister" )); + remoteLister->openUrl(url); + return true; + } + + QString path = url.toLocalFile(); - if (!path.endsWith(QDir::separator())) path += QDir::separator(); + if (!path.endsWith(QDir::separator())) path += QDir::separator(); - Chain<Folder> *trees = new Chain<Folder>; + Chain<Folder> *trees = new Chain<Folder>; - /* CHECK CACHE + /* CHECK CACHE * user wants: /usr/local/ * cached: /usr/ * @@ -95,97 +104,68 @@ * cached: /usr/local/, /usr/include/ */ - for (Iterator<Folder> it = m_cache->iterator(); it != m_cache->end(); ++it) - { - QString cachePath = (*it)->name(); - - if (path.startsWith(cachePath)) //then whole tree already scanned - { - //find a pointer to the requested branch - - qDebug() << "Cache-(a)hit: " << cachePath << endl; - -#if QT_VERSION >= 0x050400 - QVector<QStringRef> split = path.midRef(cachePath.length()).split(QLatin1Char( '/' )); -#else - QStringList split = path.mid(cachePath.length()).split(QLatin1Char( '/' )); -#endif - Folder *d = *it; - Iterator<File> jt; - - while (!split.isEmpty() && d != NULL) //if NULL we have got lost so abort!! - { - jt = d->iterator(); - - const Link<File> *end = d->end(); -#if QT_VERSION >= 0x050400 - if (split.first().isEmpty()) //found the dir - break; - QString s = split.first() % QLatin1Char( '/' ); -#else - QString s = split.first(); - if (s.isEmpty()) //found the dir - break; - s += QLatin1Char( '/' ); -#endif + for (Iterator<Folder> it = m_cache->iterator(); it != m_cache->end(); ++it) { + QString cachePath = (*it)->name(); - for (d = 0; jt != end; ++jt) - if (s == (*jt)->name()) - { - d = (Folder*)*jt; - break; - } + if (path.startsWith(cachePath)) { //then whole tree already scanned + //find a pointer to the requested branch - split.pop_front(); - } + qDebug() << "Cache-(a)hit: " << cachePath; - if (d) - { - delete trees; + QVector<QStringRef> split = path.midRef(cachePath.length()).split(QLatin1Char('/')); + Folder *d = *it; + Iterator<File> jt; - //we found a completed tree, thus no need to scan - qDebug() << "Found cache-handle, generating map.." << endl; + while (!split.isEmpty() && d != NULL) { //if NULL we have got lost so abort!! + jt = d->iterator(); - emit branchCacheHit(d); - - return true; + const Link<File> *end = d->end(); + if (split.first().isEmpty()) { //found the dir + break; } - else - { - //something went wrong, we couldn't find the folder we were expecting - qWarning() << "Didn't find " << path << " in the cache!\n"; - delete it.remove(); //safest to get rid of it - break; //do a full scan + QString s = split.first() % QLatin1Char('/'); // % is the string concatenation operator for QStringBuilder + + for (d = 0; jt != end; ++jt) { + if (s == (*jt)->name()) { + d = (Folder*)*jt; + break; + } } + + split.pop_front(); } - else if (cachePath.startsWith(path)) //then part of the requested tree is already scanned - { - qDebug() << "Cache-(b)hit: " << cachePath << endl; - it.transferTo(*trees); - } - } - QGuiApplication::changeOverrideCursor(QCursor(Qt::BusyCursor)); - //starts listing by itself - m_thread = new Filelight::LocalLister(path, trees, this); - connect(m_thread, SIGNAL(branchCompleted(Folder*,bool)), this, SLOT(cacheTree(Folder*,bool)), Qt::QueuedConnection); - m_thread->start(); + if (d) { + delete trees; - return true; + //we found a completed tree, thus no need to scan + qDebug() << "Found cache-handle, generating map.."; + + emit branchCacheHit(d); + + return true; + } else { + //something went wrong, we couldn't find the folder we were expecting + qWarning() << "Didn't find " << path << " in the cache!\n"; + delete it.remove(); //safest to get rid of it + break; //do a full scan + } + } else if (cachePath.startsWith(path)) { //then part of the requested tree is already scanned + qDebug() << "Cache-(b)hit: " << cachePath; + it.transferTo(*trees); + } } QGuiApplication::changeOverrideCursor(QCursor(Qt::BusyCursor)); - //will start listing straight away - Filelight::RemoteLister *remoteLister = new Filelight::RemoteLister(url, (QWidget*)parent(), this); - connect(remoteLister, SIGNAL(branchCompleted(Folder*,bool)), this, SLOT(cacheTree(Folder*,bool)), Qt::QueuedConnection); - remoteLister->setParent(this); - remoteLister->setObjectName(QLatin1String( "remote_lister" )); - remoteLister->openUrl(url); + //starts listing by itself + m_thread = new Filelight::LocalLister(path, trees, this); + connect(m_thread, &LocalLister::branchCompleted, this, &ScanManager::cacheTree, Qt::QueuedConnection); + m_thread->start(); + return true; } -bool -ScanManager::abort() +bool ScanManager::abort() { m_abort = true; @@ -194,21 +174,20 @@ return m_thread && m_thread->wait(); } -void -ScanManager::emptyCache() +void ScanManager::emptyCache() { m_abort = true; - if (m_thread && m_thread->isRunning()) + if (m_thread && m_thread->isRunning()) { m_thread->wait(); + } emit aboutToEmptyCache(); m_cache->empty(); } -void -ScanManager::cacheTree(Folder *tree, bool finished) +void ScanManager::cacheTree(Folder *tree) { QMutexLocker locker(&m_mutex); // This gets released once it is destroyed. @@ -225,18 +204,15 @@ if (tree) { //we don't cache foreign stuff //we don't recache stuff (thus only type 1000 events) - if (finished) - //TODO sanity check the cache - m_cache->append(tree); - } - else //scan failed + m_cache->append(tree); + } else { //scan failed m_cache->empty(); //FIXME this is safe but annoying + } QGuiApplication::restoreOverrideCursor(); } -void -ScanManager::foundCached(Folder *tree) +void ScanManager::foundCached(Folder *tree) { emit completed(tree); QGuiApplication::restoreOverrideCursor(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/scan.h new/filelight-16.08.0/src/part/scan.h --- old/filelight-16.04.3/src/part/scan.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/scan.h 2016-07-02 15:21:38.000000000 +0200 @@ -32,6 +32,9 @@ namespace Filelight { + +class LocalLister; + class ScanManager : public QObject { Q_OBJECT @@ -53,13 +56,12 @@ public slots: bool abort(); void emptyCache(); - void cacheTree(Folder*, bool); + void cacheTree(Folder*); void foundCached(Folder*); signals: void completed(Folder*); void aboutToEmptyCache(); - void branchCompleted(Folder* tree, bool finished); void branchCacheHit(Folder* tree); private: @@ -67,7 +69,7 @@ uint m_files; QMutex m_mutex; - QThread *m_thread; + LocalLister *m_thread; Chain<Folder> *m_cache; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/settingsDialog.cpp new/filelight-16.08.0/src/part/settingsDialog.cpp --- old/filelight-16.04.3/src/part/settingsDialog.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/settingsDialog.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -64,32 +64,29 @@ //read in settings before you make all those nasty connections! reset(); //makes dialog reflect global settings - connect(&m_timer, SIGNAL(timeout()), SIGNAL(mapIsInvalid())); + connect(&m_timer, &QTimer::timeout, this, &SettingsDialog::mapIsInvalid); - connect(m_addButton, SIGNAL(clicked()), SLOT(addFolder())); - connect(m_removeButton, SIGNAL(clicked()), SLOT(removeFolder())); - connect(resetButton, SIGNAL(clicked()), SLOT(reset())); - connect(closeButton, SIGNAL(clicked()), SLOT(close())); - - connect(m_schemaGroup, SIGNAL(buttonClicked(int)), SLOT(changeScheme(int))); - connect(contrastSlider, SIGNAL(valueChanged(int)), SLOT(changeContrast(int))); - connect(contrastSlider, SIGNAL(sliderReleased()), SLOT(slotSliderReleased())); - - connect(scanAcrossMounts, SIGNAL(toggled(bool)), SLOT(startTimer())); - connect(dontScanRemoteMounts, SIGNAL(toggled(bool)), SLOT(startTimer())); - connect(dontScanRemovableMedia, SIGNAL(toggled(bool)), SLOT(startTimer())); - connect(scanAcrossMounts, SIGNAL(toggled(bool)), - SLOT(toggleScanAcrossMounts(bool))); - connect(dontScanRemoteMounts, SIGNAL(toggled(bool)), - SLOT(toggleDontScanRemoteMounts(bool))); - connect(dontScanRemovableMedia, SIGNAL(toggled(bool)), - SLOT(toggleDontScanRemovableMedia(bool))); - - connect(useAntialiasing, SIGNAL(toggled(bool)), SLOT(toggleUseAntialiasing(bool))); - connect(varyLabelFontSizes, SIGNAL(toggled(bool)), SLOT(toggleVaryLabelFontSizes(bool))); - connect(showSmallFiles, SIGNAL(toggled(bool)), SLOT(toggleShowSmallFiles(bool))); + connect(m_addButton, &QPushButton::clicked, this, &SettingsDialog::addFolder); + connect(m_removeButton, &QPushButton::clicked, this, &SettingsDialog::removeFolder); + connect(resetButton, &QPushButton::clicked, this, &SettingsDialog::reset); + connect(closeButton, &QPushButton::clicked, this, &SettingsDialog::close); + + connect(m_schemaGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SettingsDialog::changeScheme); + connect(contrastSlider, &QSlider::valueChanged, this, &SettingsDialog::changeContrast); + connect(contrastSlider, &QSlider::sliderReleased, this, &SettingsDialog::slotSliderReleased); + + connect(scanAcrossMounts, &QCheckBox::toggled, this, &SettingsDialog::startTimer); + connect(dontScanRemoteMounts, &QCheckBox::toggled, this, &SettingsDialog::startTimer); + connect(dontScanRemovableMedia, &QCheckBox::toggled, this, &SettingsDialog::startTimer); + connect(scanAcrossMounts, &QCheckBox::toggled, this, &SettingsDialog::toggleScanAcrossMounts); + connect(dontScanRemoteMounts, &QCheckBox::toggled, this, &SettingsDialog::toggleDontScanRemoteMounts); + connect(dontScanRemovableMedia, &QCheckBox::toggled, this, &SettingsDialog::toggleDontScanRemovableMedia); + + connect(useAntialiasing, &QCheckBox::toggled, this, &SettingsDialog::toggleUseAntialiasing); + connect(varyLabelFontSizes, &QCheckBox::toggled, this, &SettingsDialog::toggleVaryLabelFontSizes); + connect(showSmallFiles, &QCheckBox::toggled, this, &SettingsDialog::toggleShowSmallFiles); - connect(minFontPitch, SIGNAL (valueChanged(int)), SLOT(changeMinFontPitch(int))); + connect(minFontPitch, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SettingsDialog::changeMinFontPitch); m_addButton->setIcon(QIcon::fromTheme(QLatin1String("folder-open"))); m_removeButton->setIcon(QIcon::fromTheme(QLatin1String("list-remove"))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/summaryWidget.cpp new/filelight-16.08.0/src/part/summaryWidget.cpp --- old/filelight-16.04.3/src/part/summaryWidget.cpp 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/summaryWidget.cpp 2016-07-02 15:21:38.000000000 +0200 @@ -41,6 +41,9 @@ #include <QMouseEvent> #include <QLayout> +namespace Filelight +{ + struct Disk { QString mount; @@ -60,6 +63,8 @@ class MyRadialMap : public RadialMap::Widget { + Q_OBJECT + public: MyRadialMap(QWidget *parent) : RadialMap::Widget(parent, true) @@ -148,7 +153,7 @@ map->create(tree); //must be done when visible - connect(map, SIGNAL(activated(QUrl)), SIGNAL(activated(QUrl))); + connect(map, &RadialMap::Widget::activated, this, &SummaryWidget::activated); } } @@ -182,3 +187,7 @@ *this += disk; } } + +} + +#include "summaryWidget.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/filelight-16.04.3/src/part/summaryWidget.h new/filelight-16.08.0/src/part/summaryWidget.h --- old/filelight-16.04.3/src/part/summaryWidget.h 2016-04-21 21:31:52.000000000 +0200 +++ new/filelight-16.08.0/src/part/summaryWidget.h 2016-07-02 15:21:38.000000000 +0200 @@ -26,6 +26,8 @@ #include <QWidget> +namespace Filelight { + class SummaryWidget : public QWidget { Q_OBJECT @@ -40,4 +42,6 @@ void createDiskMaps(); }; +} + #endif
