Hello community, here is the log from the commit of package baloo5 for openSUSE:Factory checked in at 2016-04-12 19:08:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/baloo5 (Old) and /work/SRC/openSUSE:Factory/.baloo5.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "baloo5" Changes: -------- --- /work/SRC/openSUSE:Factory/baloo5/baloo5.changes 2016-03-26 15:21:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.baloo5.new/baloo5.changes 2016-04-12 19:08:32.000000000 +0200 @@ -1,0 +2,14 @@ +Mon Apr 4 14:18:15 UTC 2016 - hrvoje.sen...@gmail.com + +- Update to 5.21.0 (boo#974793) + * Centralize batch size in config + * Remove code blocking indexing of text/plain files + without .txt extension (kde#358098) + * Check both, filename and filecontent to determine mimetype + (kde#353512) + * Upgrade Qt version requirement to 5.4.0 + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.21.0.php +- Drop upstreamed Do-not-block-indexing-of-text-plain-files-without-txt-extension.patch + +------------------------------------------------------------------- Old: ---- Do-not-block-indexing-of-text-plain-files-without-txt-extension.patch baloo-5.20.0.tar.xz New: ---- baloo-5.21.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ baloo5.spec ++++++ --- /var/tmp/diff_new_pack.Qv2uyL/_old 2016-04-12 19:08:33.000000000 +0200 +++ /var/tmp/diff_new_pack.Qv2uyL/_new 2016-04-12 19:08:33.000000000 +0200 @@ -17,9 +17,9 @@ %bcond_without lang -%define _tar_path 5.20 +%define _tar_path 5.21 Name: baloo5 -Version: 5.20.0 +Version: 5.21.0 Release: 0 %define kf5_version %{version} Summary: Framework for searching and managing metadata @@ -31,8 +31,6 @@ Source99: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE fix-cmakelists-comments.diff -- Change cmake 3.0 block comments to work in cmake 2.x Patch1: fix-cmakelists-comments.diff -# PATCH-FIX-UPSTREAM Do-not-block-indexing-of-text-plain-files-without-txt-extension.patch (kde#358098) -- fixes indexing of text/plain files without .txt extension -Patch2: Do-not-block-indexing-of-text-plain-files-without-txt-extension.patch BuildRequires: extra-cmake-modules >= %{_tar_path} BuildRequires: kf5-filesystem BuildRequires: libattr-devel @@ -148,7 +146,6 @@ %prep %setup -q -n baloo-%{version} %patch1 -p1 -%patch2 -p1 %build %cmake_kf5 -d build -- -DCMAKE_INSTALL_LOCALEDIR=share/locale/kf5 ++++++ baloo-5.20.0.tar.xz -> baloo-5.21.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/.gitignore new/baloo-5.21.0/.gitignore --- old/baloo-5.20.0/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/baloo-5.21.0/.gitignore 2016-04-03 22:42:08.000000000 +0200 @@ -0,0 +1,33 @@ +# C++ objects and libs + +*.slo +*.lo +*.o +*.a +*.la +*.lai +*.so +*.dll +*.dylib + +# Qt-es + +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc +moc_*.cpp +qrc_*.cpp +ui_*.h +Makefile* +*-build-* + +# QtCreator + +*CMakeLists.txt.user +*.autosave +*.qmlproject.user +*.qmlproject.user.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/CMakeLists.txt new/baloo-5.21.0/CMakeLists.txt --- old/baloo-5.20.0/CMakeLists.txt 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/CMakeLists.txt 2016-04-03 22:42:08.000000000 +0200 @@ -1,14 +1,30 @@ +# set minimum version requirements cmake_minimum_required(VERSION 2.8.12) +set(REQUIRED_QT_VERSION 5.4.0) +set(KF5_VERSION "5.21.0") # handled by release scripts +set(KF5_DEP_VERSION "5.21.0") # handled by release scripts +# set up project project(Baloo) +# set up extra-cmake-modules before trying anything else include(FeatureSummary) -find_package(ECM 5.20.0 REQUIRED NO_MODULE) -set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") + +find_package(ECM ${KF5_DEP_VERSION} NO_MODULE) +set_package_properties(ECM + PROPERTIES + TYPE REQUIRED + DESCRIPTION "Extra CMake Modules" + URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules" +) feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) +# we found extra-cmake-modules, so use it now +set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} +) +# include optional and extra cmake stuff include(GenerateExportHeader) include(ECMGenerateHeaders) include(ECMPackageConfigHelpers) @@ -19,29 +35,27 @@ include(ECMInstallIcons) include(ECMAddTests) -set(KF5_VERSION "5.20.0") # handled by release scripts -set(KF5_DEP_VERSION "5.20.0") # handled by release scripts - -ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX BALOO - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h" - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfigVersion.cmake" - SOVERSION 5 +# set up baloo versions +ecm_setup_version(${KF5_VERSION} + VARIABLE_PREFIX BALOO + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfigVersion.cmake" + SOVERSION 5 ) -# Build dependencies -set(REQUIRED_QT_VERSION 5.3.0) +# set up build dependencies find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core DBus Widgets Qml Quick Test) - find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS CoreAddons Config DBusAddons I18n IdleTime Solid FileMetaData Crash KIO) find_package(LMDB) -set_package_properties(LMDB PROPERTIES - DESCRIPTION "Lightning Memory-Mapped Database (LMDB)" - URL "http://symas.com/mdb" - TYPE REQUIRED +set_package_properties(LMDB + PROPERTIES + DESCRIPTION "Lightning Memory-Mapped Database (LMDB)" + URL "http://symas.com/mdb" + TYPE REQUIRED ) -# Compiler flags +# compiler flags and build system add_definitions(-DQT_NO_KEYWORDS) remove_definitions(-DQT_NO_CAST_FROM_ASCII) @@ -51,32 +65,38 @@ endif() include_directories( - ${LMDB_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/lib - ${CMAKE_BINARY_DIR}/src/lib - ${CMAKE_SOURCE_DIR}/src/codecs - ${CMAKE_BINARY_DIR}/src/engine - ${CMAKE_SOURCE_DIR}/src/engine - ${CMAKE_BINARY_DIR}/src/file - ${CMAKE_SOURCE_DIR}/src/file - ${CMAKE_BINARY_DIR}/src/dbus + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + + # we'll configure the rest here so that we don't have to + # specify them in the source and test directories separately + ${CMAKE_SOURCE_DIR}/src/lib + ${CMAKE_BINARY_DIR}/src/lib + ${CMAKE_BINARY_DIR}/src/codecs + ${CMAKE_SOURCE_DIR}/src/codecs + ${CMAKE_BINARY_DIR}/src/engine + ${CMAKE_SOURCE_DIR}/src/engine + ${CMAKE_BINARY_DIR}/src/file + ${CMAKE_SOURCE_DIR}/src/file + ${CMAKE_BINARY_DIR}/src/dbus + ${CMAKE_SOURCE_DIR}/src/dbus ) -# Targets +# targets add_subdirectory(src) add_subdirectory(icons) -if (${BUILD_KINOTIFY}) +if (BUILD_KINOTIFY) add_subdirectory(tests) add_subdirectory(autotests) endif() +# i18n if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) endif() -# Config files +# config files set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Baloo") ecm_configure_package_config_file( @@ -86,6 +106,7 @@ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) +# install targets install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfigVersion.cmake" @@ -94,9 +115,9 @@ ) install(EXPORT KF5BalooTargets - NAMESPACE KF5:: - DESTINATION "${CMAKECONFIG_INSTALL_DIR}" - FILE KF5BalooTargets.cmake) + NAMESPACE KF5:: + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + FILE KF5BalooTargets.cmake) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h" @@ -104,7 +125,5 @@ COMPONENT Devel ) -feature_summary(WHAT ALL - INCLUDE_QUIET_PACKAGES - FATAL_ON_MISSING_REQUIRED_PACKAGES -) +# and we're done +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/po/ast/balooctl.po new/baloo-5.21.0/po/ast/balooctl.po --- old/baloo-5.20.0/po/ast/balooctl.po 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/po/ast/balooctl.po 2016-04-03 22:42:08.000000000 +0200 @@ -7,8 +7,8 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2015-12-15 08:19+0000\n" -"PO-Revision-Date: 2016-02-03 01:51+0100\n" -"Last-Translator: enolp <en...@sofastur.org>\n" +"PO-Revision-Date: 2016-03-08 15:23+0100\n" +"Last-Translator: enolp <en...@softastur.org>\n" "Language-Team: Asturian <>\n" "Language: ast\n" "MIME-Version: 1.0\n" @@ -152,12 +152,12 @@ #: configcommand.cpp:179 #, kde-format msgid "%1 is not in the list of include folders" -msgstr "" +msgstr "%1 nun ta nel llistáu de carpetes incluyíes" #: configcommand.cpp:209 #, kde-format msgid "%1 is not in the list of exclude folders" -msgstr "" +msgstr "%1 nun ta nel llistáu de carpetes escluyíes" #: configcommand.cpp:221 configcommand.cpp:356 msgid "A filter must be provided" @@ -180,7 +180,7 @@ #: configcommand.cpp:290 #, kde-format msgid "%1 is already in the list of include folders" -msgstr "" +msgstr "%1 yá ta nel llistáu de carpetes incluyíes" #: configcommand.cpp:296 #, kde-format @@ -195,7 +195,7 @@ #: configcommand.cpp:332 #, kde-format msgid "%1 is already in the list of exclude folders" -msgstr "" +msgstr "%1 yá ta nel llistáu de carpetes escluyíes" #: configcommand.cpp:338 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/CMakeLists.txt new/baloo-5.21.0/src/CMakeLists.txt --- old/baloo-5.20.0/src/CMakeLists.txt 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/CMakeLists.txt 2016-04-03 22:42:08.000000000 +0200 @@ -3,7 +3,7 @@ add_subdirectory(codecs) add_subdirectory(qml) -if (${BUILD_KINOTIFY}) +if (BUILD_KINOTIFY) add_subdirectory(file) add_subdirectory(kioslaves) add_subdirectory(tools) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/engine/transaction.cpp new/baloo-5.21.0/src/engine/transaction.cpp --- old/baloo-5.20.0/src/engine/transaction.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/engine/transaction.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -436,7 +436,7 @@ MDB_envinfo info; mdb_env_info(m_env, &info); - dbSize.actualSize = info.me_last_pgno * 4096; + dbSize.actualSize = info.me_last_pgno * 4096; // TODO: separate page size return dbSize; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/extractor/app.cpp new/baloo-5.21.0/src/file/extractor/app.cpp --- old/baloo-5.20.0/src/file/extractor/app.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/extractor/app.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -126,7 +126,7 @@ void App::index(Transaction* tr, const QString& url, quint64 id) { - QString mimetype = m_mimeDb.mimeTypeForFile(url, QMimeDatabase::MatchContent).name(); + QString mimetype = m_mimeDb.mimeTypeForFile(url).name(); bool shouldIndex = m_config.shouldBeIndexed(url) && m_config.shouldMimeTypeBeIndexed(mimetype); if (!shouldIndex) { @@ -135,18 +135,6 @@ return; } - // - // HACK: We only want to index plain text files which end with a .txt - // - if (mimetype == QLatin1String("text/plain")) { - if (!url.endsWith(QLatin1String(".txt"))) { - qCDebug(BALOO) << "text/plain does not end with .txt. Ignoring"; - tr->removePhaseOne(id); - return; - } - } - - // // HACK: Also, we're ignoring ttext files which are greater tha 10 Mb as we // have trouble processing them // diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/filecontentindexer.cpp new/baloo-5.21.0/src/file/filecontentindexer.cpp --- old/baloo-5.20.0/src/file/filecontentindexer.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/filecontentindexer.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -28,8 +28,10 @@ using namespace Baloo; -FileContentIndexer::FileContentIndexer(FileContentIndexerProvider* provider, QObject* parent) +FileContentIndexer::FileContentIndexer(FileIndexerConfig* config, FileContentIndexerProvider* provider, QObject* parent) : QObject(parent) + , m_config(config) + , m_batchSize(config->maxUncomittedFiles()) , m_provider(provider) , m_stop(0) { @@ -54,13 +56,13 @@ m_stop.store(false); while (m_provider->size() && !m_stop.load()) { // - // WARNING: This will go mad, if the Extractor does not commit after 40 files - // cause then we will keep fetching the same 40 again and again. + // WARNING: This will go mad, if the Extractor does not commit after N=m_batchSize files + // cause then we will keep fetching the same N files again and again. // QElapsedTimer timer; timer.start(); - QVector<quint64> idList = m_provider->fetch(40); + QVector<quint64> idList = m_provider->fetch(m_batchSize); if (idList.isEmpty() || m_stop.load()) { break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/filecontentindexer.h new/baloo-5.21.0/src/file/filecontentindexer.h --- old/baloo-5.20.0/src/file/filecontentindexer.h 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/filecontentindexer.h 2016-04-03 22:42:08.000000000 +0200 @@ -27,6 +27,7 @@ #include <QDBusServiceWatcher> #include <QDBusMessage> +#include "fileindexerconfig.h" namespace Baloo { @@ -39,7 +40,7 @@ Q_PROPERTY(QString currentFile READ currentFile NOTIFY startedIndexingFile) public: - FileContentIndexer(FileContentIndexerProvider* provider, QObject* parent = 0); + FileContentIndexer(FileIndexerConfig* config, FileContentIndexerProvider* provider, QObject* parent = 0); QString currentFile() { return m_currentFile; } @@ -66,6 +67,8 @@ void slotFinishedIndexingFile(const QString& filePath); private: + FileIndexerConfig *m_config; + uint m_batchSize; FileContentIndexerProvider* m_provider; QAtomicInt m_stop; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/fileindexerconfig.cpp new/baloo-5.21.0/src/file/fileindexerconfig.cpp --- old/baloo-5.20.0/src/file/fileindexerconfig.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/fileindexerconfig.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -60,6 +60,7 @@ , m_config(QStringLiteral("baloofilerc")) , m_indexHidden(false) , m_devices(new StorageDevices(this)) + , m_maxUncomittedFiles(40) { forceConfigUpdate(); } @@ -352,3 +353,8 @@ return m_config.group("Basic Settings").readEntry("Indexing-Enabled", true); } +uint FileIndexerConfig::maxUncomittedFiles() +{ + return m_maxUncomittedFiles; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/fileindexerconfig.h new/baloo-5.21.0/src/file/fileindexerconfig.h --- old/baloo-5.20.0/src/file/fileindexerconfig.h 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/fileindexerconfig.h 2016-04-03 22:42:08.000000000 +0200 @@ -146,6 +146,11 @@ bool indexingEnabled() const; + /** + * Returns batch size + */ + uint maxUncomittedFiles(); + public Q_SLOTS: /** * Reread the config from disk and update the configuration cache. @@ -184,6 +189,8 @@ bool m_onlyBasicIndexing; StorageDevices* m_devices; + + const uint m_maxUncomittedFiles; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/fileindexscheduler.cpp new/baloo-5.21.0/src/file/fileindexscheduler.cpp --- old/baloo-5.20.0/src/file/fileindexscheduler.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/fileindexscheduler.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -42,7 +42,7 @@ , m_provider(db) , m_contentIndexer(0) , m_indexerState(Idle) - , m_timeEstimator(this) + , m_timeEstimator(config, this) , m_checkUnindexedFiles(false) { Q_ASSERT(db); @@ -53,7 +53,7 @@ connect(&m_powerMonitor, &PowerStateMonitor::powerManagementStatusChanged, this, &FileIndexScheduler::powerManagementStatusChanged); - m_contentIndexer = new FileContentIndexer(&m_provider, this); + m_contentIndexer = new FileContentIndexer(m_config, &m_provider, this); m_contentIndexer->setAutoDelete(false); connect(m_contentIndexer, &FileContentIndexer::done, this, &FileIndexScheduler::scheduleIndexing); @@ -208,3 +208,8 @@ m_checkUnindexedFiles = true; scheduleIndexing(); } + +uint FileIndexScheduler::getBatchSize() +{ + return m_config->maxUncomittedFiles(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/fileindexscheduler.h new/baloo-5.21.0/src/file/fileindexscheduler.h --- old/baloo-5.20.0/src/file/fileindexscheduler.h 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/fileindexscheduler.h 2016-04-03 22:42:08.000000000 +0200 @@ -80,6 +80,7 @@ Q_SCRIPTABLE void resume() { setSuspend(false); } Q_SCRIPTABLE uint getRemainingTime(); Q_SCRIPTABLE void checkUnindexedFiles(); + Q_SCRIPTABLE uint getBatchSize(); private Q_SLOTS: void powerManagementStatusChanged(bool isOnBattery); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/timeestimator.cpp new/baloo-5.21.0/src/file/timeestimator.cpp --- old/baloo-5.20.0/src/file/timeestimator.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/timeestimator.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -27,11 +27,14 @@ using namespace Baloo; -TimeEstimator::TimeEstimator(QObject* parent) +TimeEstimator::TimeEstimator(FileIndexerConfig *config, QObject* parent) : QObject(parent) , m_bufferIndex(0) , m_estimateReady(false) + , m_config(config) + , m_batchSize(m_config->maxUncomittedFiles()) { + } uint TimeEstimator::calculateTimeLeft(int filesLeft) @@ -54,7 +57,7 @@ } float weightedAverage = totalTime / totalWeight; - float batchesLeft = (float)filesLeft / (float)40; + float batchesLeft = (float)filesLeft / (float)m_batchSize; return weightedAverage * batchesLeft; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/file/timeestimator.h new/baloo-5.21.0/src/file/timeestimator.h --- old/baloo-5.20.0/src/file/timeestimator.h 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/file/timeestimator.h 2016-04-03 22:42:08.000000000 +0200 @@ -25,6 +25,7 @@ #define BUFFER_SIZE 5 +#include "fileindexerconfig.h" #include <QObject> namespace Baloo { @@ -34,10 +35,11 @@ * 5 most recent batches. The more recent the batch is, higher the weight * it will be assigned. */ + class TimeEstimator : public QObject { public: - explicit TimeEstimator(QObject* parent = 0); + explicit TimeEstimator(FileIndexerConfig* config, QObject* parent = 0); uint calculateTimeLeft(int filesLeft); public Q_SLOTS: @@ -45,9 +47,12 @@ private: uint m_batchTimeBuffer[BUFFER_SIZE]; - int m_bufferIndex; + int m_bufferIndex; bool m_estimateReady; + + FileIndexerConfig* m_config; + uint m_batchSize; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/qml/experimental/monitor.cpp new/baloo-5.21.0/src/qml/experimental/monitor.cpp --- old/baloo-5.20.0/src/qml/experimental/monitor.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/qml/experimental/monitor.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -85,7 +85,7 @@ } Q_EMIT newFileIndexed(); - if (m_filesIndexed % (40 * 5) == 0) { + if (m_filesIndexed % (m_scheduler->getBatchSize() * 5) == 0) { updateRemainingTime(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/tools/balooctl/indexer.cpp new/baloo-5.21.0/src/tools/balooctl/indexer.cpp --- old/baloo-5.20.0/src/tools/balooctl/indexer.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/tools/balooctl/indexer.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -38,7 +38,7 @@ void Indexer::index() { - const QString mimetype = m_mimeDB.mimeTypeForFile(m_url, QMimeDatabase::MatchContent).name(); + const QString mimetype = m_mimeDB.mimeTypeForFile(m_url).name(); BasicIndexingJob basicIJ(m_url, mimetype, BasicIndexingJob::NoLevel); basicIJ.index(); Baloo::Document doc = basicIJ.document(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/src/tools/balooctl/statuscommand.cpp new/baloo-5.21.0/src/tools/balooctl/statuscommand.cpp --- old/baloo-5.20.0/src/tools/balooctl/statuscommand.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/src/tools/balooctl/statuscommand.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -115,7 +115,7 @@ return 0; } else { // FIXME: Add why it is not being indexed! - out << "Disbabled\n"; + out << "Disabled\n"; return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-5.20.0/tests/file/indexerconfigtest.cpp new/baloo-5.21.0/tests/file/indexerconfigtest.cpp --- old/baloo-5.20.0/tests/file/indexerconfigtest.cpp 2016-03-05 19:44:14.000000000 +0100 +++ new/baloo-5.21.0/tests/file/indexerconfigtest.cpp 2016-04-03 22:42:08.000000000 +0200 @@ -49,7 +49,7 @@ bool shouldIndex = config.shouldBeIndexed(url); QMimeDatabase m_mimeDb; - QString mimetype = m_mimeDb.mimeTypeForFile(url, QMimeDatabase::MatchContent).name(); + QString mimetype = m_mimeDb.mimeTypeForFile(url).name(); QString fastMimetype = m_mimeDb.mimeTypeForFile(url, QMimeDatabase::MatchExtension).name(); bool shouldIndexMimetype = config.shouldMimeTypeBeIndexed(fastMimetype);