#include "panels/places/placesitemmodel.h"
#include "panels/places/placesitem.h"
#include "views/viewproperties.h"
#include "panels/places/placesitemmodel.h"
#include "panels/places/placesitem.h"
#include "views/viewproperties.h"
static QString bookmarksFile()
{
return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel";
static QString bookmarksFile()
{
return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel";
QMap<QString, QDBusInterface *> m_interfacesMap;
int m_expectedModelCount = 15;
bool m_hasDesktopFolder = false;
QMap<QString, QDBusInterface *> m_interfacesMap;
int m_expectedModelCount = 15;
bool m_hasDesktopFolder = false;
void createPlaceItem(const QString &text, const QUrl &url, const QString &icon);
void schedulePlaceRemoval(int index);
void cancelPlaceRemoval(int index);
void createPlaceItem(const QString &text, const QUrl &url, const QString &icon);
void schedulePlaceRemoval(int index);
void cancelPlaceRemoval(int index);
-void PlacesItemModelTest::removeTestUserData()
-{
- // user hardcoded path to avoid removal of any user personal data
- QDir dir(QStringLiteral("/home/renato/.qttest/share/placesitemmodeltest"));
- if (dir.exists()) {
- QVERIFY(dir.removeRecursively());
- }
-}
-
if (QDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).exists()) {
m_hasDownloadsFolder = true;
m_expectedModelCount++;
if (QDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).exists()) {
m_hasDownloadsFolder = true;
m_expectedModelCount++;
QCOMPARE(groups.at(0).first, 0);
QCOMPARE(groups.at(0).second.toString(), QStringLiteral("Places"));
QCOMPARE(groups.at(0).first, 0);
QCOMPARE(groups.at(0).second.toString(), QStringLiteral("Places"));
QFETCH(bool, expectedPreviewShow);
QFETCH(QList<QByteArray>, expectedVisibleRole);
QFETCH(bool, expectedPreviewShow);
QFETCH(QList<QByteArray>, expectedVisibleRole);
ViewProperties properties(KFilePlacesModel::convertedUrl(url));
QCOMPARE(properties.viewMode(), expectedViewMode);
QCOMPARE(properties.previewsShown(), expectedPreviewShow);
QCOMPARE(properties.visibleRoles(), expectedVisibleRole);
ViewProperties properties(KFilePlacesModel::convertedUrl(url));
QCOMPARE(properties.viewMode(), expectedViewMode);
QCOMPARE(properties.previewsShown(), expectedPreviewShow);
QCOMPARE(properties.visibleRoles(), expectedVisibleRole);