┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt41
-rw-r--r--src/dolphincontextmenu.cpp9
-rw-r--r--src/dolphincontextmenu.h5
-rw-r--r--src/dolphinmainwindow.cpp1
-rw-r--r--src/dolphinpart.cpp4
-rw-r--r--src/dolphinpart.desktop3
-rw-r--r--src/dolphintabpage.h2
-rw-r--r--src/kitemviews/kfileitemlistwidget.cpp2
-rw-r--r--src/kitemviews/kfileitemmodel.cpp42
-rw-r--r--src/kitemviews/kfileitemmodel.h6
-rw-r--r--src/kitemviews/kitemlistview.h21
-rwxr-xr-xsrc/org.kde.dolphin.desktop1
-rw-r--r--src/panels/places/placespanel.cpp4
-rw-r--r--src/settings/kcm/kcmdolphingeneral.desktop2
-rw-r--r--src/settings/kcm/kcmdolphinnavigation.desktop2
-rw-r--r--src/settings/kcm/kcmdolphinservices.desktop2
-rw-r--r--src/settings/kcm/kcmdolphinviewmodes.desktop1
-rw-r--r--src/statusbar/statusbarspaceinfo.cpp5
-rw-r--r--src/tests/CMakeLists.txt156
-rw-r--r--src/tests/dolphinmainwindowtest.cpp69
-rw-r--r--src/tests/kfileitemmodeltest.cpp3
-rw-r--r--src/tests/kitemlistselectionmanagertest.cpp37
-rw-r--r--src/views/dolphinview.cpp2
23 files changed, 222 insertions, 198 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ce4cec80c..bc6f75d62 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -193,7 +193,7 @@ install(FILES dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
##########################################
-set(dolphin_SRCS
+set(dolphinstatic_SRCS
dolphindockwidget.cpp
dolphinmainwindow.cpp
dolphinviewcontainer.cpp
@@ -248,11 +248,10 @@ set(dolphin_SRCS
statusbar/statusbarspaceinfo.cpp
views/zoomlevelinfo.cpp
dolphindebug.cpp
- dbusinterface.cpp
global.cpp
)
-kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC
+kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
panels/folders/dolphin_folderspanelsettings.kcfgc
panels/information/dolphin_informationpanelsettings.kcfgc
panels/places/dolphin_placespanelsettings.kcfgc
@@ -265,36 +264,44 @@ kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC
)
if(NOT WIN32)
- set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp)
+ set(dolphinstatic_SRCS ${dolphinstatic_SRCS} panels/terminal/terminalpanel.cpp)
endif()
-# Sets the icon on Windows and OSX
-file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
-ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
-
-kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
+add_library(dolphinstatic STATIC ${dolphinstatic_SRCS})
-target_include_directories(kdeinit_dolphin PRIVATE ${PHONON_INCLUDES})
-
-target_link_libraries(kdeinit_dolphin
+target_include_directories(dolphinstatic PRIVATE ${PHONON_INCLUDES})
+target_link_libraries(dolphinstatic
dolphinprivate
- KF5::Parts
KF5::KCMUtils
- KF5::Solid
- KF5::CoreAddons
KF5::DBusAddons
- KF5::Bookmarks
KF5::Notifications
Phonon::phonon4qt5
)
if (KF5Activities_FOUND)
target_link_libraries(
- kdeinit_dolphin
+ dolphinstatic
KF5::Activities
)
endif()
+set(dolphin_SRCS
+ dbusinterface.cpp
+ main.cpp
+)
+
+# Sets the icon on Windows and OSX
+file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
+ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
+
+kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
+
+
+target_link_libraries(kdeinit_dolphin
+ dolphinstatic
+ dolphinprivate
+)
+
include(DbusInterfaceMacros)
generate_and_install_dbus_interface(
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 890494ff8..05082df86 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -283,7 +283,7 @@ void DolphinContextMenu::openItemContextMenu()
fileItemActions.setItemListProperties(selectedItemsProps);
addServiceActions(fileItemActions);
- addFileItemPluginActions(fileItemActions);
+ fileItemActions.addPluginActionsTo(this);
addVersionControlPluginActions();
@@ -355,7 +355,7 @@ void DolphinContextMenu::openViewportContextMenu()
fileItemActions.setItemListProperties(baseUrlProperties);
addServiceActions(fileItemActions);
- addFileItemPluginActions(fileItemActions);
+ fileItemActions.addPluginActionsTo(this);
addVersionControlPluginActions();
@@ -484,11 +484,6 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions)
fileItemActions.addServiceActionsTo(this);
}
-void DolphinContextMenu::addFileItemPluginActions(KFileItemActions& fileItemActions)
-{
- fileItemActions.addPluginActionsTo(this);
-}
-
void DolphinContextMenu::addVersionControlPluginActions()
{
const DolphinView* view = m_mainWindow->activeViewContainer()->view();
diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h
index f67300dc1..ea68244e1 100644
--- a/src/dolphincontextmenu.h
+++ b/src/dolphincontextmenu.h
@@ -124,11 +124,6 @@ private:
void addServiceActions(KFileItemActions& fileItemActions);
/**
- * Adds actions that are provided by a KFileItemActionPlugin.
- */
- void addFileItemPluginActions(KFileItemActions& fileItemActions);
-
- /**
* Adds actions that are provided by a KVersionControlPlugin.
*/
void addVersionControlPluginActions();
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 4b01272b7..3d6f8489d 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -124,6 +124,7 @@ DolphinMainWindow::DolphinMainWindow() :
setAcceptDrops(true);
m_tabWidget = new DolphinTabWidget(this);
+ m_tabWidget->setObjectName("tabWidget");
connect(m_tabWidget, &DolphinTabWidget::activeViewChanged,
this, &DolphinMainWindow::activeViewChanged);
connect(m_tabWidget, &DolphinTabWidget::tabCountChanged,
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 352e9a44f..ef9b300ca 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -352,7 +352,7 @@ void DolphinPart::slotRequestItemInfo(const KFileItem& item)
updateStatusBar();
} else {
const QString escapedText = Qt::convertFromPlainText(item.getStatusBarInfo());
- ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
+ emit ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
}
}
@@ -575,7 +575,7 @@ void DolphinPart::updateStatusBar()
void DolphinPart::updateProgress(int percent)
{
- m_extension->loadingProgress(percent);
+ emit m_extension->loadingProgress(percent);
}
void DolphinPart::createDirectory()
diff --git a/src/dolphinpart.desktop b/src/dolphinpart.desktop
index da0a659d3..a0d7a96b2 100644
--- a/src/dolphinpart.desktop
+++ b/src/dolphinpart.desktop
@@ -71,6 +71,7 @@ Name[et]=Ikoonid
Name[fi]=Kuvakkeet
Name[fr]=Icônes
Name[gl]=Iconas
+Name[he]=סמלים
Name[hu]=Ikonok
Name[ia]=Icones
Name[id]=Ikon
@@ -118,6 +119,7 @@ Name[et]=Kompaktne
Name[fi]=Tiivis
Name[fr]=Concis
Name[gl]=Compacta
+Name[he]=קומפקטי
Name[hu]=Kompakt
Name[ia]=Compacte
Name[id]=Sederhana
@@ -165,6 +167,7 @@ Name[et]=Üksikasjad
Name[fi]=Yksityiskohdat
Name[fr]=Détails
Name[gl]=Detalles
+Name[he]=פרטים
Name[hu]=Részletek
Name[ia]=Detalios
Name[id]=Detail
diff --git a/src/dolphintabpage.h b/src/dolphintabpage.h
index 45c540775..b8772602d 100644
--- a/src/dolphintabpage.h
+++ b/src/dolphintabpage.h
@@ -127,7 +127,7 @@ public:
* @deprecated The first tab state version has no version number, we keep
* this method to restore old states (<= Dolphin 4.14.x).
*/
- void restoreStateV1(const QByteArray& state);
+ Q_DECL_DEPRECATED void restoreStateV1(const QByteArray& state);
/**
* Set whether the tab page is active
diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp
index d28ddd2e3..fa98093b5 100644
--- a/src/kitemviews/kfileitemlistwidget.cpp
+++ b/src/kitemviews/kfileitemlistwidget.cpp
@@ -80,7 +80,7 @@ QString KFileItemListWidgetInformant::roleText(const QByteArray& role,
const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
text = KFormat().formatByteSize(size);
}
- } else if (role == "modificationtime" || role == "accesstime") {
+ } else if (role == "modificationtime" || role == "accesstime" || role == "deletiontime") {
const QDateTime dateTime = roleValue.toDateTime();
text = QLocale().toString(dateTime, QLocale::ShortFormat);
} else {
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 41ddb43b4..da64895fb 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -329,8 +329,21 @@ QList<QPair<int, QVariant> > KFileItemModel::groups() const
switch (typeForRole(sortRole())) {
case NameRole: m_groups = nameRoleGroups(); break;
case SizeRole: m_groups = sizeRoleGroups(); break;
- case ModificationTimeRole: m_groups = timeRoleGroups(KFileItem::ModificationTime); break;
- case AccessTimeRole: m_groups = timeRoleGroups(KFileItem::AccessTime); break;
+ case ModificationTimeRole:
+ m_groups = timeRoleGroups([](const ItemData *item) {
+ return item->item.time(KFileItem::ModificationTime);
+ });
+ break;
+ case AccessTimeRole:
+ m_groups = timeRoleGroups([](const ItemData *item) {
+ return item->item.time(KFileItem::AccessTime);
+ });
+ break;
+ case DeletionTimeRole:
+ m_groups = timeRoleGroups([](const ItemData *item) {
+ return item->values.value("deletiontime").toDateTime();
+ });
+ break;
case PermissionsRole: m_groups = permissionRoleGroups(); break;
case RatingRole: m_groups = ratingRoleGroups(); break;
default: m_groups = genericStringRoleGroups(sortRole()); break;
@@ -1321,6 +1334,7 @@ void KFileItemModel::prepareItemsForSorting(QList<ItemData*>& itemDataList)
case GroupRole:
case DestinationRole:
case PathRole:
+ case DeletionTimeRole:
// These roles can be determined with retrieveData, and they have to be stored
// in the QHash "values" for the sorting.
foreach (ItemData* itemData, itemDataList) {
@@ -1599,6 +1613,14 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem& item,
data.insert(sharedValue("path"), path);
}
+ if (m_requestRole[DeletionTimeRole]) {
+ QDateTime deletionTime;
+ if (item.url().scheme() == QLatin1String("trash")) {
+ deletionTime = QDateTime::fromString(item.entry().stringValue(KIO::UDSEntry::UDS_EXTRA + 1), Qt::ISODate);
+ }
+ data.insert(sharedValue("deletiontime"), deletionTime);
+ }
+
if (m_requestRole[IsExpandableRole] && isDir) {
data.insert(sharedValue("isExpandable"), true);
}
@@ -1789,6 +1811,17 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const
break;
}
+ case DeletionTimeRole: {
+ const QDateTime dateTimeA = a->values.value("deletiontime").toDateTime();
+ const QDateTime dateTimeB = b->values.value("deletiontime").toDateTime();
+ if (dateTimeA < dateTimeB) {
+ result = -1;
+ } else if (dateTimeA > dateTimeB) {
+ result = +1;
+ }
+ break;
+ }
+
case RatingRole: {
result = a->values.value("rating").toInt() - b->values.value("rating").toInt();
break;
@@ -1958,7 +1991,7 @@ QList<QPair<int, QVariant> > KFileItemModel::sizeRoleGroups() const
return groups;
}
-QList<QPair<int, QVariant> > KFileItemModel::timeRoleGroups(KFileItem::FileTimes which) const
+QList<QPair<int, QVariant> > KFileItemModel::timeRoleGroups(std::function<QDateTime(const ItemData *)> fileTimeCb) const
{
Q_ASSERT(!m_itemData.isEmpty());
@@ -1974,7 +2007,7 @@ QList<QPair<int, QVariant> > KFileItemModel::timeRoleGroups(KFileItem::FileTimes
continue;
}
- const QDateTime fileTime = m_itemData.at(i)->item.time(which);
+ const QDateTime fileTime = fileTimeCb(m_itemData.at(i));
const QDate fileDate = fileTime.date();
if (fileDate == previousFileDate) {
// The current item is in the same group as the previous item
@@ -2253,6 +2286,7 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count)
{ "duration", DurationRole, I18N_NOOP2_NOSTRIP("@label", "Duration"), I18N_NOOP2_NOSTRIP("@label", "Audio"), true, true },
{ "track", TrackRole, I18N_NOOP2_NOSTRIP("@label", "Track"), I18N_NOOP2_NOSTRIP("@label", "Audio"), true, true },
{ "path", PathRole, I18N_NOOP2_NOSTRIP("@label", "Path"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
+ { "deletiontime",DeletionTimeRole,I18N_NOOP2_NOSTRIP("@label", "Deletion Time"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
{ "destination", DestinationRole, I18N_NOOP2_NOSTRIP("@label", "Link Destination"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
{ "originUrl", OriginUrlRole, I18N_NOOP2_NOSTRIP("@label", "Downloaded From"), I18N_NOOP2_NOSTRIP("@label", "Other"), true, false },
{ "permissions", PermissionsRole, I18N_NOOP2_NOSTRIP("@label", "Permissions"), I18N_NOOP2_NOSTRIP("@label", "Other"), false, false },
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h
index 9814ae55d..c73df9050 100644
--- a/src/kitemviews/kfileitemmodel.h
+++ b/src/kitemviews/kfileitemmodel.h
@@ -30,6 +30,8 @@
#include <QHash>
#include <QSet>
+#include <functional>
+
class KFileItemModelDirLister;
class QTimer;
@@ -281,7 +283,7 @@ private:
enum RoleType {
// User visible roles:
NoRole, NameRole, SizeRole, ModificationTimeRole, AccessTimeRole, PermissionsRole, OwnerRole,
- GroupRole, TypeRole, DestinationRole, PathRole,
+ GroupRole, TypeRole, DestinationRole, PathRole, DeletionTimeRole,
// User visible roles available with Baloo:
CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
WordCountRole, TitleRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
@@ -383,7 +385,7 @@ private:
QList<QPair<int, QVariant> > nameRoleGroups() const;
QList<QPair<int, QVariant> > sizeRoleGroups() const;
- QList<QPair<int, QVariant> > timeRoleGroups(KFileItem::FileTimes which) const;
+ QList<QPair<int, QVariant> > timeRoleGroups(std::function<QDateTime(const ItemData *)> fileTimeCb) const;
QList<QPair<int, QVariant> > permissionRoleGroups() const;
QList<QPair<int, QVariant> > ratingRoleGroups() const;
QList<QPair<int, QVariant> > genericStringRoleGroups(const QByteArray& typeForRole) const;
diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h
index c93297c47..ed1199877 100644
--- a/src/kitemviews/kitemlistview.h
+++ b/src/kitemviews/kitemlistview.h
@@ -197,12 +197,13 @@ public:
int lastVisibleIndex() const;
/**
- * @return Calculates the required size for all items in the model.
- * It might be larger than KItemListView::itemSize().
- * In this case the layout grid will be stretched to assure an
- * unclipped item.
- * NOTE: the logical height (width) is actually the
- * width (height) if the scroll orientation is Qt::Vertical!
+ * Calculates the required size for all items in the model.
+ * It might be larger than KItemListView::itemSize().
+ * In this case the layout grid will be stretched to assure an
+ * unclipped item.
+ *
+ * @note the logical height (width) is actually the
+ * width (height) if the scroll orientation is Qt::Vertical!
*/
void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint) const;
@@ -824,13 +825,13 @@ public:
KItemListWidgetCreator();
virtual ~KItemListWidgetCreator();
- virtual KItemListWidget* create(KItemListView* view);
+ virtual KItemListWidget* create(KItemListView* view) Q_DECL_OVERRIDE;
- virtual void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const;
+ virtual void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const Q_DECL_OVERRIDE;
virtual qreal preferredRoleColumnWidth(const QByteArray& role,
int index,
- const KItemListView* view) const;
+ const KItemListView* view) const Q_DECL_OVERRIDE;
private:
KItemListWidgetInformant* m_informant;
};
@@ -893,7 +894,7 @@ class KItemListGroupHeaderCreator : public KItemListGroupHeaderCreatorBase
{
public:
virtual ~KItemListGroupHeaderCreator();
- virtual KItemListGroupHeader* create(KItemListView* view);
+ virtual KItemListGroupHeader* create(KItemListView* view) Q_DECL_OVERRIDE;
};
template <class T>
diff --git a/src/org.kde.dolphin.desktop b/src/org.kde.dolphin.desktop
index 63b72d966..f187cef58 100755
--- a/src/org.kde.dolphin.desktop
+++ b/src/org.kde.dolphin.desktop
@@ -62,6 +62,7 @@ GenericName[et]=Failihaldur
GenericName[fi]=Tiedostonhallinta
GenericName[fr]=Gestionnaire de fichiers
GenericName[gl]=Xestor de ficheiros
+GenericName[he]=מנהל קבצים
GenericName[hu]=Fájlkezelő
GenericName[ia]=Gerente de file
GenericName[id]=Manajer Berkas
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp
index 17367b865..3c9309435 100644
--- a/src/panels/places/placespanel.cpp
+++ b/src/panels/places/placespanel.cpp
@@ -197,7 +197,9 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
menu.addSeparator();
}
- editAction = menu.addAction(QIcon::fromTheme("document-properties"), i18nc("@item:inmenu", "Edit..."));
+ if (!isDevice) {
+ editAction = menu.addAction(QIcon::fromTheme("document-properties"), i18nc("@item:inmenu", "Edit..."));
+ }
QAction* removeAction = 0;
if (!isDevice && !item->isSystemItem()) {
diff --git a/src/settings/kcm/kcmdolphingeneral.desktop b/src/settings/kcm/kcmdolphingeneral.desktop
index 556231e44..eb9809bb8 100644
--- a/src/settings/kcm/kcmdolphingeneral.desktop
+++ b/src/settings/kcm/kcmdolphingeneral.desktop
@@ -108,6 +108,7 @@ Name[et]=Üldine
Name[fi]=Yleiset
Name[fr]=Général
Name[gl]=Xerais
+Name[he]=כללי
Name[hu]=Általános
Name[ia]=General
Name[id]=Umum
@@ -191,6 +192,7 @@ X-KDE-Keywords[et]=failihaldur
X-KDE-Keywords[fi]=tiedostonhallinta
X-KDE-Keywords[fr]=gestionnaire de fichiers
X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
diff --git a/src/settings/kcm/kcmdolphinnavigation.desktop b/src/settings/kcm/kcmdolphinnavigation.desktop
index 9280624d6..238f5d266 100644
--- a/src/settings/kcm/kcmdolphinnavigation.desktop
+++ b/src/settings/kcm/kcmdolphinnavigation.desktop
@@ -107,6 +107,7 @@ Name[et]=Liikumine
Name[fi]=Selaus
Name[fr]=Navigation
Name[gl]=Navegación
+Name[he]=ניווט
Name[hu]=Navigálás
Name[ia]=Navigation
Name[id]=Navigasi
@@ -192,6 +193,7 @@ X-KDE-Keywords[et]=failihaldur
X-KDE-Keywords[fi]=tiedostonhallinta
X-KDE-Keywords[fr]=gestionnaire de fichiers
X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
diff --git a/src/settings/kcm/kcmdolphinservices.desktop b/src/settings/kcm/kcmdolphinservices.desktop
index 42e0538fa..0b41019a8 100644
--- a/src/settings/kcm/kcmdolphinservices.desktop
+++ b/src/settings/kcm/kcmdolphinservices.desktop
@@ -66,6 +66,7 @@ Name[et]=Teenused
Name[fi]=Palvelut
Name[fr]=Services
Name[gl]=Servizos
+Name[he]=שירותים
Name[hu]=Szolgáltatások
Name[ia]=Servicios
Name[id]=Layanan
@@ -149,6 +150,7 @@ X-KDE-Keywords[et]=failihaldur
X-KDE-Keywords[fi]=tiedostonhallinta
X-KDE-Keywords[fr]=gestionnaire de fichiers
X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
diff --git a/src/settings/kcm/kcmdolphinviewmodes.desktop b/src/settings/kcm/kcmdolphinviewmodes.desktop
index 0be2656a0..41062deff 100644
--- a/src/settings/kcm/kcmdolphinviewmodes.desktop
+++ b/src/settings/kcm/kcmdolphinviewmodes.desktop
@@ -191,6 +191,7 @@ X-KDE-Keywords[et]=failihaldur
X-KDE-Keywords[fi]=tiedostonhallinta
X-KDE-Keywords[fr]=gestionnaire de fichiers
X-KDE-Keywords[gl]=xestor de ficheiros
+X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp
index 03ab247ca..f364fcf5b 100644
--- a/src/statusbar/statusbarspaceinfo.cpp
+++ b/src/statusbar/statusbarspaceinfo.cpp
@@ -27,7 +27,7 @@
#include <KLocalizedString>
#include <KNS3/KMoreToolsMenuFactory>
#include <KIO/Job>
-
+#include <knewstuff_version.h>
StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) :
KCapacityBar(KCapacityBar::DrawTextInline, parent),
@@ -78,6 +78,9 @@ void StatusBarSpaceInfo::mousePressEvent(QMouseEvent* event)
// Note that this object must live long enough in case the user opens
// the "Configure..." dialog
KMoreToolsMenuFactory menuFactory(QStringLiteral("dolphin/statusbar-diskspace-menu"));
+#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 37, 0)
+ menuFactory.setParentWidget(this);
+#endif
auto menu = menuFactory.createMenuFromGroupingNames(
{ "disk-usage", "more:", "disk-partitions" }, m_url);
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index c7159bf1b..1c2335cbf 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -1,155 +1,59 @@
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
find_package(Qt5Test CONFIG REQUIRED)
-include(ECMMarkAsTest)
-
-# needed on windows to correctly use the files from dolphinprivate
-add_definitions(-DDOLPHIN_EXPORT=)
+include(ECMAddTests)
# KItemSetTest
-set(kitemsettest_SRCS
- kitemsettest.cpp
-)
-
-add_executable(kitemsettest ${kitemsettest_SRCS})
-add_test(kitemsettest kitemsettest)
-ecm_mark_as_test(kitemsettest)
-target_link_libraries(kitemsettest dolphinprivate Qt5::Test)
+ecm_add_test(kitemsettest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
# KItemRangeTest
-set(kitemrangetest_SRCS
- kitemrangetest.cpp
-)
-
-add_executable(kitemrangetest ${kitemrangetest_SRCS})
-add_test(kitemrangetest kitemrangetest)
-ecm_mark_as_test(kitemrangetest)
-target_link_libraries(kitemrangetest dolphinprivate Qt5::Test)
+ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
# KItemListSelectionManagerTest
-set(kitemlistselectionmanagertest_SRCS
- kitemlistselectionmanagertest.cpp
-)
-
-add_executable(kitemlistselectionmanagertest ${kitemlistselectionmanagertest_SRCS})
-add_test(kitemlistselectionmanagertest kitemlistselectionmanagertest)
-ecm_mark_as_test(kitemlistselectionmanagertest)
-target_link_libraries(kitemlistselectionmanagertest dolphinprivate Qt5::Test)
+ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
# KItemListControllerTest
-set(kitemlistcontrollertest_SRCS
- kitemlistcontrollertest.cpp
- testdir.cpp
- ../dolphindebug.cpp
-)
-
-kconfig_add_kcfg_files(kitemlistcontrollertest_SRCS GENERATE_MOC
- ../settings/dolphin_generalsettings.kcfgc
-)
-
-add_executable(kitemlistcontrollertest ${kitemlistcontrollertest_SRCS})
-add_test(kitemlistcontrollertest kitemlistcontrollertest)
-ecm_mark_as_test(kitemlistcontrollertest)
-target_link_libraries(kitemlistcontrollertest dolphinprivate Qt5::Test)
+ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp
+TEST_NAME kitemlistcontrollertest
+LINK_LIBRARIES dolphinprivate Qt5::Test)
# KFileItemListViewTest
-set(kfileitemlistviewtest_SRCS
- kfileitemlistviewtest.cpp
- testdir.cpp
- ../dolphindebug.cpp
-)
-
-kconfig_add_kcfg_files(kfileitemlistviewtest_SRCS GENERATE_MOC
- ../settings/dolphin_generalsettings.kcfgc
-)
-
-add_executable(kfileitemlistviewtest ${kfileitemlistviewtest_SRCS})
-add_test(kfileitemlistviewtest kfileitemlistviewtest)
-ecm_mark_as_test(kfileitemlistviewtest)
-target_link_libraries(kfileitemlistviewtest dolphinprivate Qt5::Test)
+ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp
+TEST_NAME kfileitemlistviewtest
+LINK_LIBRARIES dolphinprivate Qt5::Test)
# KFileItemModelTest
-set(kfileitemmodeltest_SRCS
- kfileitemmodeltest.cpp
- testdir.cpp
- ../dolphindebug.cpp
-)
-
-kconfig_add_kcfg_files(kfileitemmodeltest_SRCS GENERATE_MOC
- ../settings/dolphin_generalsettings.kcfgc
-)
-
-add_executable(kfileitemmodeltest ${kfileitemmodeltest_SRCS})
-add_test(kfileitemmodeltest kfileitemmodeltest)
-ecm_mark_as_test(kfileitemmodeltest)
-target_link_libraries(kfileitemmodeltest dolphinprivate Qt5::Test)
+ecm_add_test(kfileitemmodeltest.cpp testdir.cpp
+TEST_NAME kfileitemmodeltest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
# KFileItemModelBenchmark
-set(kfileitemmodelbenchmark_SRCS
- kfileitemmodelbenchmark.cpp
- testdir.cpp
- ../dolphindebug.cpp
-)
-
-kconfig_add_kcfg_files(kfileitemmodelbenchmark_SRCS GENERATE_MOC
- ../settings/dolphin_generalsettings.kcfgc
-)
-
-add_executable(kfileitemmodelbenchmark ${kfileitemmodelbenchmark_SRCS})
-ecm_mark_as_test(kfileitemmodelbenchmark)
-target_link_libraries(kfileitemmodelbenchmark dolphinprivate Qt5::Test)
+ecm_add_test(kfileitemmodelbenchmark.cpp testdir.cpp
+TEST_NAME kfileitemmodelbenchmark
+LINK_LIBRARIES dolphinprivate Qt5::Test)
# KItemListKeyboardSearchManagerTest
-set(kitemlistkeyboardsearchmanagertest_SRCS
- kitemlistkeyboardsearchmanagertest.cpp
-)
-
-add_executable(kitemlistkeyboardsearchmanagertest ${kitemlistkeyboardsearchmanagertest_SRCS})
-add_test(kitemlistkeyboardsearchmanagertest kitemlistkeyboardsearchmanagertest)
-ecm_mark_as_test(kitemlistkeyboardsearchmanagertest)
-target_link_libraries(kitemlistkeyboardsearchmanagertest dolphinprivate Qt5::Test)
+ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
# DolphinSearchBox
if (KF5Baloo_FOUND)
- set(dolphinsearchboxtest_SRCS
- dolphinsearchboxtest.cpp
- ../search/dolphinfacetswidget.cpp
- ../search/dolphinsearchbox.cpp
- )
- kconfig_add_kcfg_files(dolphinsearchboxtest_SRCS
- ../search/dolphin_searchsettings.kcfgc
- )
-
- add_executable(dolphinsearchboxtest ${dolphinsearchboxtest_SRCS})
- add_test(dolphinsearchboxtest dolphinsearchboxtest)
- ecm_mark_as_test(dolphinsearchboxtest)
- target_link_libraries(dolphinsearchboxtest dolphinprivate Qt5::Test)
+ ecm_add_test(dolphinsearchboxtest.cpp
+ TEST_NAME dolphinsearchboxtest
+ LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
endif()
# KStandardItemModelTest
-set(kstandarditemmodeltest_SRCS
- kstandarditemmodeltest.cpp
- ../dolphindebug.cpp
-)
-
-add_executable(kstandarditemmodeltest ${kstandarditemmodeltest_SRCS})
-add_test(kstandarditemmodeltest kstandarditemmodeltest)
-ecm_mark_as_test(kstandarditemmodeltest)
-target_link_libraries(kstandarditemmodeltest dolphinprivate Qt5::Test)
+ecm_add_test(kstandarditemmodeltest.cpp
+TEST_NAME kstandarditemmodeltest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
# ViewPropertiesTest
-set(viewpropertiestest_SRCS
- viewpropertiestest.cpp
- testdir.cpp
- ../dolphindebug.cpp
-)
-kconfig_add_kcfg_files(viewpropertiestest_SRCS GENERATE_MOC
- ../settings/dolphin_generalsettings.kcfgc
- ../settings/dolphin_directoryviewpropertysettings.kcfgc
-)
+ecm_add_test(viewpropertiestest.cpp testdir.cpp
+TEST_NAME viewpropertiestest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
-add_executable(viewpropertiestest ${viewpropertiestest_SRCS})
-add_test(viewpropertiestest viewpropertiestest)
-ecm_mark_as_test(viewpropertiestest)
-target_link_libraries(viewpropertiestest dolphinprivate Qt5::Test)
+# DolphinMainWindowTest
+ecm_add_test(dolphinmainwindowtest.cpp
+TEST_NAME dolphinmainwindowtest
+LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
diff --git a/src/tests/dolphinmainwindowtest.cpp b/src/tests/dolphinmainwindowtest.cpp
new file mode 100644
index 000000000..be86c5016
--- /dev/null
+++ b/src/tests/dolphinmainwindowtest.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2017 by Elvis Angelaccio <[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 *
+ ***************************************************************************/
+
+#include "dolphinmainwindow.h"
+#include "dolphintabpage.h"
+#include "dolphintabwidget.h"
+#include "dolphinviewcontainer.h"
+
+#include <QTest>
+
+class DolphinMainWindowTest : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void init();
+ void testClosingTabsWithSearchBoxVisible();
+
+private:
+ QScopedPointer<DolphinMainWindow> m_mainWindow;
+};
+
+void DolphinMainWindowTest::init()
+{
+ m_mainWindow.reset(new DolphinMainWindow());
+}
+
+// See https://bugs.kde.org/show_bug.cgi?id=379135
+void DolphinMainWindowTest::testClosingTabsWithSearchBoxVisible()
+{
+ m_mainWindow->openDirectories({ QUrl::fromLocalFile(QDir::homePath()) }, false);
+ m_mainWindow->show();
+ // Without this call the searchbox doesn't get FocusIn events.
+ QTest::qWaitForWindowExposed(m_mainWindow.data());
+ QVERIFY(m_mainWindow->isVisible());
+
+ auto tabWidget = m_mainWindow->findChild<DolphinTabWidget*>("tabWidget");
+ QVERIFY(tabWidget);
+
+ // Show search box on first tab.
+ tabWidget->currentTabPage()->activeViewContainer()->setSearchModeEnabled(true);
+
+ tabWidget->openNewActivatedTab(QUrl::fromLocalFile(QDir::homePath()));
+ QCOMPARE(tabWidget->count(), 2);
+
+ // Triggers the crash in bug #379135.
+ tabWidget->closeTab();
+ QCOMPARE(tabWidget->count(), 1);
+}
+
+QTEST_MAIN(DolphinMainWindowTest)
+
+#include "dolphinmainwindowtest.moc"
diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp
index 59ff63069..b8e089530 100644
--- a/src/tests/kfileitemmodeltest.cpp
+++ b/src/tests/kfileitemmodeltest.cpp
@@ -135,10 +135,11 @@ void KFileItemModelTest::cleanup()
void KFileItemModelTest::testDefaultRoles()
{
const QSet<QByteArray> roles = m_model->roles();
- QCOMPARE(roles.count(), 3);
+ QCOMPARE(roles.count(), 4);
QVERIFY(roles.contains("text"));
QVERIFY(roles.contains("isDir"));
QVERIFY(roles.contains("isLink"));
+ QVERIFY(roles.contains("isHidden"));
}
void KFileItemModelTest::testDefaultSortRole()
diff --git a/src/tests/kitemlistselectionmanagertest.cpp b/src/tests/kitemlistselectionmanagertest.cpp
index 18a79bd3f..48e8dce04 100644
--- a/src/tests/kitemlistselectionmanagertest.cpp
+++ b/src/tests/kitemlistselectionmanagertest.cpp
@@ -335,27 +335,26 @@ Q_DECLARE_METATYPE(QList<int>)
*
* The test is data-driven and takes the following arguments:
*
- * \param initialSelection The selection at the beginning.
- * \param anchor This item will be the anchor item.
- * \param current This item will be the current item.
- * \param expectedSelection Expected selection after anchor and current are set.
- * \param changeType Type of the change that is done then:
- * - NoChange
- * - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted()
- * - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved()
- * - MoveItems -> data.at(0) provides the KItemRange containing the original indices,
- * data.at(1) provides the list containing the new indices
- * \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved()
- * - EndAnchoredSelection
- * - SetSelected -> data.at(0) provides the index where the selection process starts,
- * data.at(1) provides the number of indices to be selected,
- * data.at(2) provides the selection mode.
- * \sa KItemListSelectionManager::setSelected()
- * \param data A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above).
- * \param finalSelection The expected final selection.
+ * param initialSelection The selection at the beginning.
+ * param anchor This item will be the anchor item.
+ * param current This item will be the current item.
+ * param expectedSelection Expected selection after anchor and current are set.
+ * param changeType Type of the change that is done then:
+ * - NoChange
+ * - InsertItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsInserted()
+ * - RemoveItems -> data.at(0) provides the KItemRangeList. \sa KItemListSelectionManager::itemsRemoved()
+ * - MoveItems -> data.at(0) provides the KItemRange containing the original indices,
+ * data.at(1) provides the list containing the new indices
+ * \sa KItemListSelectionManager::itemsMoved(), KItemModelBase::itemsMoved()
+ * - EndAnchoredSelection
+ * - SetSelected -> data.at(0) provides the index where the selection process starts,
+ * data.at(1) provides the number of indices to be selected,
+ * data.at(2) provides the selection mode.
+ * \sa KItemListSelectionManager::setSelected()
+ * param data A list of QVariants which will be cast to the arguments needed for the chosen ChangeType (see above).
+ * param finalSelection The expected final selection.
*
*/
-
void KItemListSelectionManagerTest::testChangeSelection_data()
{
QTest::addColumn<KItemSet>("initialSelection");
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index e60e85fdb..bef6a8b73 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -735,7 +735,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
if (GeneralSettings::useTabForSwitchingSplitView()) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) {
- toggleActiveViewRequested();
+ emit toggleActiveViewRequested();
return true;
}
}