Changeset View
Changeset View
Standalone View
Standalone View
src/imagefoldermodel.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | |||||
73 | 73 | | |||
74 | QString ImageFolderModel::url() const | 74 | QString ImageFolderModel::url() const | ||
75 | { | 75 | { | ||
76 | return dirLister()->url().toString(); | 76 | return dirLister()->url().toString(); | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | void ImageFolderModel::setUrl(QString& url) | 79 | void ImageFolderModel::setUrl(QString& url) | ||
80 | { | 80 | { | ||
81 | Q_ASSERT( QUrl(url).isLocalFile()); | | |||
82 | url = QUrl(url).path(); | 81 | url = QUrl(url).path(); | ||
83 | 82 | | |||
84 | if (url.isEmpty()) { | 83 | if (url.isEmpty()) { | ||
85 | QStringList locations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); | 84 | QStringList locations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); | ||
86 | Q_ASSERT(locations.size() > 1); | 85 | Q_ASSERT(locations.size() >= 1); | ||
87 | url = locations.first().append("/"); | 86 | url = locations.first().append("/"); | ||
88 | } | 87 | } | ||
89 | 88 | | |||
90 | url = QUrl::fromLocalFile(url).toString(); | 89 | url = QUrl::fromLocalFile(url).toString(); | ||
90 | Q_ASSERT( QUrl(url).isLocalFile()); | ||||
91 | 91 | | |||
92 | if (dirLister()->url().path() == QUrl(url).path()) { | 92 | if (dirLister()->url().path() == QUrl(url).path()) { | ||
93 | dirLister()->updateDirectory(QUrl(url)); | 93 | dirLister()->updateDirectory(QUrl(url)); | ||
94 | return; | 94 | return; | ||
95 | } | 95 | } | ||
96 | 96 | | |||
97 | beginResetModel(); | 97 | beginResetModel(); | ||
98 | dirLister()->openUrl(QUrl(url)); | 98 | dirLister()->openUrl(QUrl(url)); | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |