BUG: 63347
FIXED-IN: 4.6.0
svn path=/trunk/KDE/kdebase/apps/; revision=
1178321
} else if (url.isLocalFile()) {
m_filePath = url.toLocalFile();
const QFileInfo info(m_filePath);
} else if (url.isLocalFile()) {
m_filePath = url.toLocalFile();
const QFileInfo info(m_filePath);
- if (!info.isWritable()) {
+ if (!info.isWritable() || !isPartOfHome(m_filePath)) {
m_filePath = destinationDir("local") + m_filePath;
}
} else {
m_filePath = destinationDir("local") + m_filePath;
}
} else {
+
+bool ViewProperties::isPartOfHome(const QString& filePath)
+{
+ // For performance reasons cache the path in a static QString
+ // (see QDir::homePath() for more details)
+ static QString homePath;
+ if (homePath.isEmpty()) {
+ homePath = QDir::homePath();
+ Q_ASSERT(!homePath.isEmpty());
+ }
+
+ return filePath.startsWith(homePath);
+}
*/
QString viewModePrefix() const;
*/
QString viewModePrefix() const;
+ /**
+ * Returns true, if \a filePath is part of the home-path (see QDir::homePath()).
+ */
+ static bool isPartOfHome(const QString& filePath);
+
Q_DISABLE_COPY(ViewProperties)
private:
Q_DISABLE_COPY(ViewProperties)
private: