Changeset View
Changeset View
Standalone View
Standalone View
src/core/copyjob.cpp
Show First 20 Lines • Show All 1908 Lines • ▼ Show 20 Line(s) | 1904 | if (err) { | |||
---|---|---|---|---|---|
1909 | // https://codereview.qt-project.org/44823 is in | 1909 | // https://codereview.qt-project.org/44823 is in | ||
1910 | if ((err == ERR_FILE_ALREADY_EXIST || err == ERR_DIR_ALREADY_EXIST || err == ERR_IDENTICAL_FILES) && | 1910 | if ((err == ERR_FILE_ALREADY_EXIST || err == ERR_DIR_ALREADY_EXIST || err == ERR_IDENTICAL_FILES) && | ||
1911 | m_currentSrcURL.isLocalFile() && dest.isLocalFile()) { | 1911 | m_currentSrcURL.isLocalFile() && dest.isLocalFile()) { | ||
1912 | const QString _src(m_currentSrcURL.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | 1912 | const QString _src(m_currentSrcURL.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | ||
1913 | const QString _dest(dest.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | 1913 | const QString _dest(dest.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | ||
1914 | if (_src != _dest && QString::compare(_src, _dest, Qt::CaseInsensitive) == 0) { | 1914 | if (_src != _dest && QString::compare(_src, _dest, Qt::CaseInsensitive) == 0) { | ||
1915 | qCDebug(KIO_COPYJOB_DEBUG) << "Couldn't rename directly, dest already exists. Detected special case of lower/uppercase renaming in same dir, try with 2 rename calls"; | 1915 | qCDebug(KIO_COPYJOB_DEBUG) << "Couldn't rename directly, dest already exists. Detected special case of lower/uppercase renaming in same dir, try with 2 rename calls"; | ||
1916 | const QString srcDir = QFileInfo(_src).absolutePath(); | 1916 | const QString srcDir = QFileInfo(_src).absolutePath(); | ||
1917 | QTemporaryFile tmpFile(srcDir + QLatin1String("kio_XXXXXX")); | 1917 | QTemporaryFile tmpFile(srcDir + QLatin1String("/kio_XXXXXX")); | ||
chinmoyr: IMO QDir isn't required here. QLatin1String("/kio_xxxxxx") is sufficient. | |||||
1918 | const bool openOk = tmpFile.open(); | 1918 | const bool openOk = tmpFile.open(); | ||
1919 | if (!openOk) { | 1919 | if (!openOk) { | ||
1920 | qCWarning(KIO_CORE) << "Couldn't open temp file in" << srcDir; | 1920 | qCWarning(KIO_CORE) << "Couldn't open temp file in" << srcDir; | ||
1921 | } else { | 1921 | } else { | ||
1922 | const QString _tmp(tmpFile.fileName()); | 1922 | const QString _tmp(tmpFile.fileName()); | ||
1923 | tmpFile.close(); | 1923 | tmpFile.close(); | ||
1924 | tmpFile.remove(); | 1924 | tmpFile.remove(); | ||
1925 | qCDebug(KIO_COPYJOB_DEBUG) << "QTemporaryFile using" << _tmp << "as intermediary"; | 1925 | qCDebug(KIO_COPYJOB_DEBUG) << "QTemporaryFile using" << _tmp << "as intermediary"; | ||
▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines |
IMO QDir isn't required here. QLatin1String("/kio_xxxxxx") is sufficient.