[-]
[+]
|
Changed |
kio.spec
|
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/CMakeLists.txt
^
|
@@ -2,7 +2,7 @@
project(KIO)
-find_package(ECM 5.9.0 REQUIRED NO_MODULE)
+find_package(ECM 5.10.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
@@ -18,8 +18,8 @@
include(ECMGenerateHeaders)
include(ECMMarkNonGuiExecutable)
-set(KF5_VERSION "5.9.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.9.0") # handled by release scripts
+set(KF5_VERSION "5.10.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.10.0") # handled by release scripts
ecm_setup_version(
${KF5_VERSION}
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/autotests/CMakeLists.txt
^
|
@@ -60,6 +60,7 @@
kurlrequestertest.cpp
jobguitest.cpp
pastetest.cpp
+ accessmanagertest.cpp
NAME_PREFIX "kiowidgets-"
LINK_LIBRARIES KF5::KIOCore KF5::KIOWidgets Qt5::Test
)
|
[-]
[+]
|
Added |
kio-5.10.0.tar.xz/autotests/accessmanagertest.cpp
^
|
@@ -0,0 +1,83 @@
+/* This file is part of the KDE libraries
+ Copyright (c) 2015 Aleix Pol Gonzalez <aleixpol@kde.org>
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <QtTest/QtTest>
+#include <accessmanager.h>
+#include <QNetworkReply>
+
+/**
+ * Unit test for AccessManager
+ */
+class AccessManagerTest : public QObject
+{
+Q_OBJECT
+public:
+ AccessManagerTest() : m_manager(0) {}
+
+private Q_SLOTS:
+ void initTestCase()
+ {
+ qputenv("KDE_FORK_SLAVES", "yes"); // To avoid a runtime dependency on klauncher
+ qputenv("KIOSLAVE_ENABLE_TESTMODE", "1"); // ensure the ioslaves call QStandardPaths::setTestModeEnabled too
+ QStandardPaths::setTestModeEnabled(true);
+ }
+
+ void testGet()
+ {
+ const QString aFile = QFINDTESTDATA("accessmanagertest.cpp");
+ QNetworkReply* reply = m_manager.get(QNetworkRequest(QUrl::fromLocalFile(aFile)));
+ QSignalSpy spy(reply, SIGNAL(finished()));
+ QVERIFY(spy.wait());
+
+ QFile f(aFile);
+ QVERIFY(f.open(QIODevice::ReadOnly));
+ QCOMPARE(f.readAll(), reply->readAll());
+ }
+
+ void testPut()
+ {
+ const QString aDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
+ QVERIFY(QDir::temp().mkpath(aDir));
+ const QString aFile = aDir + QStringLiteral("/accessmanagertest-data");
+ const QByteArray content = "We love free software!";
+ QBuffer buffer;
+ buffer.setData(content);
+ buffer.open(QIODevice::ReadOnly);
+
+ QFile::remove(aFile);
+
+ QNetworkReply* reply = m_manager.put(QNetworkRequest(QUrl::fromLocalFile(aFile)), &buffer);
+ QSignalSpy spy(reply, SIGNAL(finished()));
+ QVERIFY(spy.wait());
+
+ QVERIFY(QFile::exists(aFile));
+ QFile f(aFile);
+ QVERIFY(f.open(QIODevice::ReadOnly));
+ QCOMPARE(f.readAll(), content);
+ }
+
+private:
+ KIO::AccessManager m_manager;
+// QNetworkAccessManager m_manager;
+};
+
+QTEST_MAIN(AccessManagerTest)
+
+#include "accessmanagertest.moc"
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/autotests/globaltest.cpp
^
|
@@ -81,20 +81,21 @@
QTest::addColumn<QStringList>("existingFiles");
QTest::addColumn<QString>("expectedOutput");
- QTest::newRow("non-existing") << "foobar" << QStringList() << "foobar 1";
- QTest::newRow("existing") << "foobar" << QStringList("foobar") << "foobar 1";
- QTest::newRow("existing_1") << "foobar" << (QStringList() << "foobar" << "foobar 1") << "foobar 2";
- QTest::newRow("extension") << "foobar.txt" << QStringList() << "foobar 1.txt";
- QTest::newRow("extension_exists") << "foobar.txt" << (QStringList() << "foobar.txt") << "foobar 1.txt";
- QTest::newRow("extension_exists_1") << "foobar.txt" << (QStringList() << "foobar.txt" << "foobar 1.txt") << "foobar 2.txt";
- QTest::newRow("two_extensions") << "foobar.tar.gz" << QStringList() << "foobar 1.tar.gz";
- QTest::newRow("two_extensions_exists") << "foobar.tar.gz" << (QStringList() << "foobar.tar.gz") << "foobar 1.tar.gz";
- QTest::newRow("two_extensions_exists_1") << "foobar.tar.gz" << (QStringList() << "foobar.tar.gz" << "foobar 1.tar.gz") << "foobar 2.tar.gz";
- QTest::newRow("with_space") << "foo bar" << QStringList("foo bar") << "foo bar 1";
- QTest::newRow("dot_at_beginning") << ".aFile.tar.gz" << QStringList() << ".aFile 1.tar.gz";
- QTest::newRow("dots_at_beginning") << "..aFile.tar.gz" << QStringList() << "..aFile 1.tar.gz";
- QTest::newRow("empty_basename") << ".txt" << QStringList() << "1.txt";
- QTest::newRow("empty_basename_2dots") << "..txt" << QStringList() << ".1.txt";
+ QTest::newRow("non-existing") << "foobar" << QStringList() << "foobar (1)";
+ QTest::newRow("existing") << "foobar" << QStringList("foobar") << "foobar (1)";
+ QTest::newRow("existing_1") << "foobar" << (QStringList() << "foobar" << "foobar (1)") << "foobar (2)";
+ QTest::newRow("extension") << "foobar.txt" << QStringList() << "foobar (1).txt";
+ QTest::newRow("extension_exists") << "foobar.txt" << (QStringList() << "foobar.txt") << "foobar (1).txt";
+ QTest::newRow("extension_exists_1") << "foobar.txt" << (QStringList() << "foobar.txt" << "foobar (1).txt") << "foobar (2).txt";
+ QTest::newRow("two_extensions") << "foobar.tar.gz" << QStringList() << "foobar (1).tar.gz";
+ QTest::newRow("two_extensions_exists") << "foobar.tar.gz" << (QStringList() << "foobar.tar.gz") << "foobar (1).tar.gz";
+ QTest::newRow("two_extensions_exists_1") << "foobar.tar.gz" << (QStringList() << "foobar.tar.gz" << "foobar (1).tar.gz") << "foobar (2).tar.gz";
+ QTest::newRow("with_space") << "foo bar" << QStringList("foo bar") << "foo bar (1)";
+ QTest::newRow("dot_at_beginning") << ".aFile.tar.gz" << QStringList() << ".aFile (1).tar.gz";
+ QTest::newRow("dots_at_beginning") << "..aFile.tar.gz" << QStringList() << "..aFile (1).tar.gz";
+ QTest::newRow("empty_basename") << ".txt" << QStringList() << ". (1).txt";
+ QTest::newRow("empty_basename_2dots") << "..txt" << QStringList() << ". (1).txt";
+ QTest::newRow("basename_with_dots") << "filename.5.3.2.tar.gz" << QStringList() << "filename.5.3.2 (1).tar.gz";
}
void GlobalTest::testSuggestName()
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/autotests/jobtest.cpp
^
|
@@ -31,6 +31,7 @@
#include <QtCore/QDir>
#include <QtCore/QHash>
#include <QtCore/QVariant>
+#include <QtCore/QBuffer>
#include <QUrl>
#include <kprotocolinfo.h>
@@ -208,6 +209,29 @@
QSignalSpy spyPercent(job, SIGNAL(percent(KJob*,ulong)));
QVERIFY(spyPercent.isValid());
QDateTime mtime = QDateTime::currentDateTime().addSecs(-30); // 30 seconds ago
+ mtime.setTime_t(mtime.toTime_t()); // hack for losing the milliseconds
+ job->setModificationTime(mtime);
+ job->setUiDelegate(0);
+ QVERIFY(job->exec());
+ QFileInfo fileInfo(filePath);
+ QVERIFY(fileInfo.exists());
+ QCOMPARE(fileInfo.size(), (long long)putData.size());
+ QCOMPARE((int)fileInfo.permissions(), (int)(QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::WriteUser));
+ QCOMPARE(fileInfo.lastModified(), mtime);
+ QVERIFY(!spyPercent.isEmpty());
+}
+
+void JobTest::storedPutIODevice()
+{
+ const QString filePath = homeTmpDir() + "fileFromHome";
+ QUrl u = QUrl::fromLocalFile(filePath);
+ QBuffer putData;
+ putData.setData("This is the put data");
+ QVERIFY(putData.open(QIODevice::ReadOnly));
+ KIO::TransferJob *job = KIO::storedPut(&putData, u, 0600, KIO::Overwrite | KIO::HideProgressInfo);
+ QSignalSpy spyPercent(job, SIGNAL(percent(KJob*,ulong)));
+ QVERIFY(spyPercent.isValid());
+ QDateTime mtime = QDateTime::currentDateTime().addSecs(-30); // 30 seconds ago
mtime.setTime_t(mtime.toTime_t()); // hack for losing the milliseconds
job->setModificationTime(mtime);
job->setUiDelegate(0);
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/autotests/jobtest.h
^
|
@@ -39,6 +39,7 @@
void storedGet();
void put();
void storedPut();
+ void storedPutIODevice();
void copyFileToSamePartition();
void copyDirectoryToSamePartition();
void copyDirectoryToExistingDirectory();
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/autotests/kdirlistertest.cpp
^
|
@@ -973,7 +973,43 @@
QCOMPARE(secondDirLister.rootItem().url().toLocalFile(), newPath);
disconnect(&secondDirLister, 0, this, 0);
- QDir().remove(newPath);
+ QDir().rmdir(newPath);
+}
+
+
+void KDirListerTest::slotOpenUrlOnRename(const QUrl & newUrl)
+{
+ QVERIFY(m_dirLister.openUrl(newUrl));
+}
+
+//This tests for a crash if you connect redirects to openUrl, due
+//to internal data being inconsistently exposed.
+//Matches usage in gwenview.
+void KDirListerTest::testRenameCurrentDirOpenUrl()
+{
+ m_items.clear();
+ const QString path = m_tempDir.path() + "/newsubdir-1/";
+ QVERIFY(QDir().mkdir(path));
+ connect(&m_dirLister, SIGNAL(newItems(KFileItemList)), this, SLOT(slotNewItems(KFileItemList)));
+
+ m_dirLister.openUrl(QUrl::fromLocalFile(path));
+ QSignalSpy spyCompleted(&m_dirLister, SIGNAL(completed()));
+ QVERIFY(spyCompleted.wait(1000));
+ QVERIFY(m_dirLister.isFinished());
+
+ const QString newPath = m_tempDir.path() + "/newsubdir-2";
+ QVERIFY(QDir().rename(path, newPath));
+
+ org::kde::KDirNotify::emitFileRenamed(QUrl::fromLocalFile(path), QUrl::fromLocalFile(newPath));
+
+ //Connect the redirection to openURL, so that on a rename the new location is opened.
+ //This matches usage in gwenview, and crashes
+ connect(&m_dirLister, SIGNAL(redirection(QUrl)), this, SLOT(slotOpenUrlOnRename(QUrl)));
+ connect(&m_dirLister, SIGNAL(redirection(QUrl)), this, SLOT(exitLoop()));
+ //Enter loop to get the redirection signal.
+ enterLoop();
+ disconnect(&m_dirLister, 0, this, 0);
+ QDir().rmdir(newPath);
}
void KDirListerTest::testRedirection()
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/autotests/kdirlistertest.h
^
|
@@ -105,6 +105,7 @@
void testOpenAndStop();
void testBug211472();
void testRenameCurrentDir();
+ void testRenameCurrentDirOpenUrl();
void testRedirection();
void testWatchingAfterCopyJob();
void testRemoveWatchedDirectory();
@@ -117,6 +118,7 @@
void slotNewItems2(const KFileItemList &);
void slotRefreshItems(const QList<QPair<KFileItem, KFileItem> > &);
void slotRefreshItems2(const QList<QPair<KFileItem, KFileItem> > &);
+ void slotOpenUrlOnRename(const QUrl &);
Q_SIGNALS:
void refreshItemsReceived();
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/cmake/FindACL.cmake
^
|
@@ -6,8 +6,29 @@
# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
include(CheckIncludeFiles)
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/cmake/FindGSSAPI.cmake
^
|
@@ -8,8 +8,29 @@
# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
if(GSSAPI_LIBS AND GSSAPI_FLAVOR)
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/core/global.cpp
^
|
@@ -387,48 +387,38 @@
QString KIO::suggestName(const QUrl &baseURL, const QString &oldName)
{
- QString dotSuffix, suggestedName;
- QString basename = oldName;
- QString spacer = QChar(' ');
-
- //ignore dots at the beginning, that way "..aFile.tar.gz" will become "..aFile 1.tar.gz" instead of " 1..aFile.tar.gz"
- int start = 0;
- while (start < basename.length()-1 && basename.at(start) == '.') {
- ++start;
- }
- // find next dot
- int index = basename.indexOf('.', start);
- if (index == -1 && start > 0) {
- // last chance, using one of the leading dots we skipped, if any
- index = start - 1;
- spacer.clear();
- }
+ QString basename;
- if (index != -1) {
- dotSuffix = basename.mid(index);
- basename.truncate(index);
+ // Extract the original file extension from the filename
+ QMimeDatabase db;
+ QString nameSuffix = db.suffixForFileName(oldName);
+
+ if (oldName.lastIndexOf('.') == 0) {
+ basename = ".";
+ nameSuffix = oldName;
+ } else if (nameSuffix.isEmpty()) {
+ basename = oldName;
+ } else {
+ nameSuffix.prepend('.');
+ basename = oldName.left(oldName.length() - nameSuffix.length());
}
- int pos = basename.lastIndexOf(spacer);
-
- if (pos != -1) {
- QString tmp = basename.mid(pos + 1);
- bool ok;
- int number = tmp.toInt(&ok);
-
- if (!ok) { // ok there is no number
- suggestedName = basename + spacer + '1' + dotSuffix;
- } else {
- // yes there's already a number behind the spacer so increment it by one
- basename.replace(pos + 1, tmp.length(), QString::number(number + 1));
- suggestedName = basename + dotSuffix;
- }
- } else { // no spacer yet
- suggestedName = basename + spacer + "1" + dotSuffix;
+ // check if (number) exists from the end of the oldName and increment that number
+ QRegExp numSearch("\\(\\d+\\)");
+ int start = numSearch.lastIndexIn(oldName);
+ if (start != -1) {
+ QString numAsStr = numSearch.cap(0);
+ QString number = QString::number(numAsStr.mid(1, numAsStr.size() - 2).toInt() + 1);
+ basename = basename.left(start) + '(' + number + ')';
+ } else {
+ // number does not exist, so just append " (1)" to filename
+ basename += " (1)";
}
+ const QString suggestedName = basename + nameSuffix;
// Check if suggested name already exists
bool exists = false;
+
// TODO: network transparency. However, using NetAccess from a modal dialog
// could be a problem, no? (given that it uses a modal widget itself....)
if (baseURL.isLocalFile()) {
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/core/kcoredirlister.cpp
^
|
@@ -1606,7 +1606,6 @@
listers |= emitRefreshItem(oldItem, *kit);
}
- emitRedirections(oldDirUrl, newDirUrl);
}
}
@@ -1620,7 +1619,10 @@
itemsInUse.remove(i.oldUrl);
itemsInUse.insert(i.newUrl, i.dirItem);
}
-
+ //Now that all the caches are updated and consistent, emit the redirection.
+ foreach(const ItemInUseChange& i, itemsToChange) {
+ emitRedirections(QUrl(i.oldUrl), QUrl(i.newUrl));
+ }
// Is oldUrl a directory in the cache?
// Remove any child of oldUrl from the cache - even if the renamed dir itself isn't in it!
removeDirFromCache(oldUrl);
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/core/krecentdocument.cpp
^
|
@@ -121,7 +121,8 @@
while (QFile::exists(ddesktop)) {
// see if it points to the same file and application
KDesktopFile tmp(ddesktop);
- if (tmp.desktopGroup().readEntry("X-KDE-LastOpenedWith") == desktopEntryName) {
+ if (tmp.desktopGroup().readPathEntry("URL", QString()) == url.toDisplayString()
+ && tmp.desktopGroup().readEntry("X-KDE-LastOpenedWith") == desktopEntryName) {
// Set access and modification time to current time
::utime(QFile::encodeName(ddesktop).constData(), NULL);
return;
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/core/storedtransferjob.cpp
^
|
@@ -157,6 +157,18 @@
return job;
}
+StoredTransferJob *KIO::storedPut(QIODevice* input, const QUrl &url, int permissions,
+ JobFlags flags)
+{
+ Q_ASSERT(input && input->isReadable());
+ KIO_ARGS << url << qint8((flags & Overwrite) ? 1 : 0) << qint8((flags & Resume) ? 1 : 0) << permissions;
+ StoredTransferJob *job = StoredTransferJobPrivate::newJob(url, CMD_PUT, packedArgs, input, flags);
+ if (!input->isSequential()) {
+ job->setTotalSize(input->size());
+ }
+ return job;
+}
+
namespace KIO
{
class PostErrorJob : public StoredTransferJob
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/core/storedtransferjob.h
^
|
@@ -86,6 +86,22 @@
KIOCORE_EXPORT StoredTransferJob *storedGet(const QUrl &url, LoadType reload = NoReload, JobFlags flags = DefaultFlags);
/**
+ * Put (a.k.a. write) data from a QIODevice.
+ * @see StoredTransferJob
+ *
+ * @param input The data to write, a device to read from
+ * @param url Where to write data.
+ * @param permissions May be -1. In this case no special permission mode is set.
+ * @param flags Can be HideProgressInfo, Overwrite and Resume here. WARNING:
+ * Setting Resume means that the data will be appended to @p dest if @p dest exists.
+ * @return the job handling the operation.
+ *
+ * @since 5.10
+ */
+KIOCORE_EXPORT StoredTransferJob *storedPut(QIODevice* input, const QUrl &url, int permissions,
+ JobFlags flags = DefaultFlags);
+
+/**
* Put (a.k.a. write) data from a single QByteArray.
* @see StoredTransferJob
*
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/filewidgets/CMakeLists.txt
^
|
@@ -23,7 +23,6 @@
kfilewidget.cpp
kfileplacesitem.cpp
kfileplacesmodel.cpp
- kfileplacessharedbookmarks.cpp
kfileplacesview.cpp
kfileplaceeditdialog.cpp
kfilepreviewgenerator.cpp
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/filewidgets/kfileplacesmodel.cpp
^
|
@@ -19,7 +19,6 @@
*/
#include "kfileplacesmodel.h"
#include "kfileplacesitem_p.h"
-#include "kfileplacessharedbookmarks_p.h"
#ifdef _WIN32_WCE
#include "Windows.h"
@@ -60,10 +59,9 @@
class KFilePlacesModel::Private
{
public:
- Private(KFilePlacesModel *self) : q(self), bookmarkManager(0), sharedBookmarks(0) {}
+ Private(KFilePlacesModel *self) : q(self), bookmarkManager(0) {}
~Private()
{
- delete sharedBookmarks;
qDeleteAll(items);
}
@@ -75,7 +73,6 @@
Solid::Predicate predicate;
KBookmarkManager *bookmarkManager;
- KFilePlacesSharedBookmarks *sharedBookmarks;
void reloadAndSignal();
QList<KFilePlacesItem *> loadBookmarkList();
@@ -92,8 +89,8 @@
KFilePlacesModel::KFilePlacesModel(QObject *parent)
: QAbstractItemModel(parent), d(new Private(this))
{
- const QString file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + "kfileplaces/bookmarks.xml";
- d->bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
+ const QString file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel";
+ d->bookmarkManager = KBookmarkManager::managerForExternalFile(file);
// Let's put some places in there if it's empty. We have a corner case here:
// Given you have bookmarked some folders (which have been saved on
@@ -145,9 +142,6 @@
d->bookmarkManager->saveAs(file);
}
- // create after, so if we have own places, they are added afterwards, in case of equal priorities
- d->sharedBookmarks = new KFilePlacesSharedBookmarks(d->bookmarkManager);
-
QString predicate("[[[[ StorageVolume.ignored == false AND [ StorageVolume.usage == 'FileSystem' OR StorageVolume.usage == 'Encrypted' ]]"
" OR "
"[ IS StorageAccess AND StorageDrive.driveType == 'Floppy' ]]"
@@ -656,8 +650,6 @@
return false;
}
- d->sharedBookmarks->updateSharedBookmarks();
-
d->reloadAndSignal();
return true;
@@ -685,8 +677,6 @@
d->bookmarkManager->root().moveBookmark(bookmark, item->bookmark());
}
- d->sharedBookmarks->updateSharedBookmarks();
-
d->reloadAndSignal();
}
@@ -714,8 +704,6 @@
bookmark.setIcon(iconName);
bookmark.setMetaDataItem("OnlyInApp", appName);
- d->sharedBookmarks->updateSharedBookmarks();
-
d->reloadAndSignal();
emit dataChanged(index, index);
}
@@ -739,7 +727,6 @@
}
d->bookmarkManager->root().deleteBookmark(bookmark);
- d->sharedBookmarks->updateSharedBookmarks();
d->reloadAndSignal();
}
@@ -759,8 +746,6 @@
bookmark.setMetaDataItem("IsHidden", (hidden ? "true" : "false"));
- d->sharedBookmarks->updateSharedBookmarks();
-
d->reloadAndSignal();
emit dataChanged(index, index);
}
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/ioslaves/ftp/ftp.cpp
^
|
@@ -2489,9 +2489,9 @@
if (bMarkPartial) {
if (iRes == statusSuccess) {
// rename ".part" on success
- if (QFile::rename(sPart, sCopyFile)) {
+ if (!QFile::rename(sPart, sCopyFile)) {
// If rename fails, try removing the destination first if it exists.
- if (!bDestExists || !(QFile::remove(sCopyFile) && QFile::rename(sPart, sCopyFile) == 0)) {
+ if (!bDestExists || !(QFile::remove(sCopyFile) && QFile::rename(sPart, sCopyFile))) {
// qDebug() << "cannot rename " << sPart << " to " << sCopyFile;
iError = ERR_CANNOT_RENAME_PARTIAL;
iRes = statusClientError;
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/ioslaves/trash/trashimpl.cpp
^
|
@@ -1155,25 +1155,23 @@
TrashSizeCache trashSize(trashPath);
DiscSpaceUtil util(trashPath + QString::fromLatin1("/files/"));
if (util.usage(trashSize.calculateSize() + additionalSize) >= percent) {
+ // before we start to remove any files from the trash,
+ // check whether the new file will fit into the trash
+ // at all...
+ qulonglong partitionSize = util.size();
+
+ if ((((double)additionalSize / (double)partitionSize) * 100) >= percent) {
+ m_lastErrorCode = KIO::ERR_SLAVE_DEFINED;
+ m_lastErrorMessage = i18n("The file is too large to be trashed.");
+ return false;
+ }
+
if (actionType == 0) { // warn the user only
m_lastErrorCode = KIO::ERR_SLAVE_DEFINED;
m_lastErrorMessage = i18n("The trash has reached its maximum size!\nCleanup the trash manually.");
return false;
} else {
- // before we start to remove any files from the trash,
- // check whether the new file will fit into the trash
- // at all...
-
- qulonglong partitionSize = util.size();
-
- if ((((double)additionalSize / (double)partitionSize) * 100) >= percent) {
- m_lastErrorCode = KIO::ERR_SLAVE_DEFINED;
- m_lastErrorMessage = i18n("The file is too large to be trashed.");
- return false;
- }
-
- // the size of the to be trashed file is ok, so lets start removing
- // some other files from the trash
+ // lets start removing some other files from the trash
QDir dir(trashPath + QString::fromLatin1("/files"));
QFileInfoList infoList;
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/kcms/kio/cache.desktop
^
|
@@ -110,6 +110,7 @@
Comment[ja]=ウェブキャッシュの設定
Comment[ko]=웹 캐시 설정
Comment[lt]=Konfigūruokite žiniatinklio podėlio nustatymus
+Comment[nb]=Tilpass innstillinger for nett-mellomlager
Comment[nl]=Hier kunt u de webcache instellen
Comment[pl]=Ustawienia pamięci podręcznej sieci
Comment[pt]=Configurar as opções de 'cache' da Web
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/kcms/kio/cookies.desktop
^
|
@@ -26,6 +26,7 @@
Name[ja]=クッキー
Name[ko]=쿠키
Name[lt]=Slapukai
+Name[nb]=Informasjonskapsler
Name[nl]=Cookies
Name[pl]=Ciasteczka
Name[pt]='Cookies'
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/kcms/kio/netpref.desktop
^
|
@@ -58,6 +58,7 @@
Name[ml]=കണക്ഷന് മുന്ഗണനകള്
Name[mr]=प्राधान्यता जुळवणी
Name[ms]=Keutamaan Sambungan
+Name[nb]=Innstillinger for tilkobling
Name[nds]=Instellen för de Verbinnen
Name[ne]=जडान प्राथमिकता
Name[nl]=Verbindingsvoorkeuren
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/kioexec/main.cpp
^
|
@@ -108,9 +108,9 @@
// Build the destination filename, in ~/.kde/cache-*/krun/
// Unlike KDE-1.1, we put the filename at the end so that the extension is kept
// (Some programs rely on it)
- QString tmp = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/krun/" +
- QString("%1_%2_%3").arg(QCoreApplication::applicationPid()).arg(jobCounter++).arg(fileName);
- QDir().mkpath(tmp); // error handling will be done by the job
+ QString krun_writable = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/krun/";
+ QDir().mkpath(krun_writable); // error handling will be done by the job
+ QString tmp = krun_writable + QString("%1_%2_%3").arg(QCoreApplication::applicationPid()).arg(jobCounter++).arg(fileName);
FileInfo file;
file.path = tmp;
file.url = url;
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/urifilters/ikws/searchproviders/grec.desktop
^
|
@@ -14,6 +14,7 @@
Name[it]=Grande dizionario della lingua catalana (GRan Enciclopèdia Catalana)
Name[ko]=카탈루냐어 대사전(GRan Enciclopèdia Catalana)
Name[lt]=Puikus katalonų kalbos žodynas (GRan Enciclopèdia Catalana)
+Name[nb]=Den store, katalanske ordboka (GRan Enciclopèdia Catalana)
Name[nl]=Groot woordenboek van de Catalaanse taal (GRan Enciclopèdia Catalana)
Name[pl]=Wielki słownik języka katalońskiego (GRan Enciclopèdia Catalana)
Name[pt]=Grande Dicionário da Língua Catalã (GRan Enciclopèdia Catalana)
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/widgets/accessmanager.cpp
^
|
@@ -252,7 +252,15 @@
case PutOperation: {
//qDebug() << "PutOperation:" << reqUrl;
if (outgoingData) {
- kioJob = KIO::storedPut(outgoingData->readAll(), reqUrl, -1, KIO::HideProgressInfo);
+ Q_ASSERT(outgoingData->isReadable());
+ StoredTransferJob* storedJob = KIO::storedPut(outgoingData, reqUrl, -1, KIO::HideProgressInfo);
+
+ QVariant len = req.header(QNetworkRequest::ContentLengthHeader);
+ if (len.isValid()) {
+ storedJob->setTotalSize(len.toInt());
+ }
+
+ kioJob = storedJob;
} else {
kioJob = KIO::put(reqUrl, -1, KIO::HideProgressInfo);
}
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/widgets/kpropertiesdialog.cpp
^
|
@@ -259,6 +259,32 @@
d->init();
}
+KPropertiesDialog::KPropertiesDialog(const QList<QUrl>& urls,
+ QWidget* parent)
+ : KPageDialog(parent), d(new KPropertiesDialogPrivate(this))
+{
+ if (urls.count() > 1) {
+ setWindowTitle(i18np("Properties for 1 item", "Properties for %1 Selected Items", urls.count()));
+ } else {
+ setWindowTitle(i18n("Properties for %1", KIO::decodeFileName(urls.first().fileName())));
+ }
+
+ Q_ASSERT(!urls.isEmpty());
+ d->m_singleUrl = urls.first();
+ Q_ASSERT(!d->m_singleUrl.isEmpty());
+
+ foreach (QUrl url, urls) {
+ KIO::StatJob *job = KIO::stat(url);
+ KJobWidgets::setWindow(job, parent);
+ job->exec();
+ KIO::UDSEntry entry = job->statResult();
+
+ d->m_items.append(KFileItem(entry, url));
+ }
+
+ d->init();
+}
+
KPropertiesDialog::KPropertiesDialog(const QUrl &_tempUrl, const QUrl &_currentDir,
const QString &_defaultName,
QWidget *parent)
@@ -367,6 +393,18 @@
return true;
}
+bool KPropertiesDialog::showDialog(const QList<QUrl> &urls, QWidget* parent,
+ bool modal)
+{
+ KPropertiesDialog *dlg = new KPropertiesDialog(urls, parent);
+ if (modal) {
+ dlg->exec();
+ } else {
+ dlg->show();
+ }
+ return true;
+}
+
void KPropertiesDialog::KPropertiesDialogPrivate::init()
{
q->setFaceType(KPageDialog::Tabbed);
@@ -1574,7 +1612,7 @@
const mode_t KFilePermissionsPropsPlugin::standardPermissions[4] = { 0, UniRead, UniRead | UniWrite, (mode_t) - 1 };
// synced with PermissionsMode and standardPermissions
-const char *KFilePermissionsPropsPlugin::permissionsTexts[4][4] = {
+const char *const KFilePermissionsPropsPlugin::permissionsTexts[4][4] = {
{
I18N_NOOP("Forbidden"),
I18N_NOOP("Can Read"),
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/widgets/kpropertiesdialog.h
^
|
@@ -123,6 +123,29 @@
QWidget *parent = 0);
/**
+ * Brings up a Properties dialog. Convenience constructor for
+ * non-file-manager applications, where you have a list of QUrls rather
+ * than a KFileItemList.
+ *
+ * @param urls list of URLs whose properties should be displayed (must
+ * contain at least one non-empty URL)
+ * @param parent is the parent of the dialog widget.
+ * @param name is the internal name.
+ *
+ * IMPORTANT: This constructor, together with exec(), leads to a grave
+ * display bug (due to KIO::stat() being run before the dialog has all the
+ * necessary information). Do not use this combination for now.
+ * TODO: Check if the above is still true with Qt4/Qt5, and if so
+ * make the initialization asynchronous.
+ * For local files with a known mimetype, simply create a KFileItemList and
+ * pass it to the other constructor.
+ *
+ * @since 5.10
+ */
+ explicit KPropertiesDialog(const QList<QUrl> &urls,
+ QWidget *parent = Q_NULLPTR);
+
+ /**
* Creates a properties dialog for a new .desktop file (whose name
* is not known yet), based on a template. Special constructor for
* "File / New" in file-manager type applications.
@@ -192,6 +215,26 @@
bool modal = true);
/**
+ * Immediately displays a Properties dialog using constructor with
+ * the same parameters.
+ *
+ * On MS Windows, if @p _urls has one element and this element points
+ * to a local file, native (non modal) property dialog is displayed
+ * (@p parent and @p modal are ignored in this case).
+ *
+ * @param urls list of URLs whose properties should be displayed (must
+ * contain at least one non-empty URL)
+ * @param parent is the parent of the dialog widget.
+ * @param modal tells the dialog whether it should be modal.
+ *
+ * @return true on successful dialog displaying (can be false on win32).
+ *
+ * @since 5.10
+ */
+ static bool showDialog(const QList<QUrl> &urls, QWidget *parent = Q_NULLPTR,
+ bool modal = true);
+
+ /**
* Adds a "3rd party" properties plugin to the dialog. Useful
* for extending the properties mechanism.
*
|
[-]
[+]
|
Changed |
kio-5.10.0.tar.xz/src/widgets/kpropertiesdialog_p.h
^
|
@@ -154,7 +154,7 @@
static const mode_t permissionsMasks[3];
static const mode_t standardPermissions[4];
- static const char *permissionsTexts[4][4];
+ static const char *const permissionsTexts[4][4];
static const mode_t fperm[3][4];
|
[-]
[+]
|
Deleted |
kio-5.9.0.tar.xz/src/filewidgets/kfileplacessharedbookmarks.cpp
^
|
@@ -1,285 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2008 Norbert Frese <nf2@scheinwelt.at>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License version 2 as published by the Free Software Foundation.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-
-*/
-
-#include "kfileplacessharedbookmarks_p.h"
-
-#include <QtCore/QObject>
-#include <QtCore/QTextStream>
-#include <QtCore/QFile>
-#include <QtCore/QDir>
-#include <QtCore/QStandardPaths>
-#include <kbookmarkmanager.h>
-#include <kbookmark.h>
-#include <QDebug>
-
-//////////////// utility functions
-
-static bool compareBookmarks(const KBookmark &bookmark1, const KBookmark &bookmark2)
-{
- return (bookmark1.url() == bookmark2.url() || bookmark1.text() == bookmark2.text());
-}
-
-static bool deepCompareDomNodes(const QDomNode &node1, const QDomNode &node2)
-{
-
- // compare name and value
- if (node1.nodeName() != node2.nodeName() || node1.nodeValue() != node2.nodeValue()) {
- return false;
- }
-
- // recursively compare children
- const QDomNodeList node1Children = node1.childNodes();
- const QDomNodeList node2Children = node2.childNodes();
-
- if (node1Children.count() != node2Children.count()) {
- return false;
- }
-
- for (int i = 0; i < node1Children.count(); i++) {
- if (!deepCompareDomNodes(node1Children.at(i), node2Children.at(i))) {
- return false;
- }
- }
- return true;
-}
-
-/*
-static QString nodeAsString(const QDomNode & node1)
-{
- QString str;
- QTextStream ts( &str, QIODevice::WriteOnly );
- ts << node1;
- return str;
-}
-*/
-
-static bool exactCompareBookmarks(const KBookmark &bookmark1, const KBookmark &bookmark2)
-{
- //qDebug() << "excat comparing:\n" << nodeAsString(bookmark1.internalElement()) << "\nwith:\n" << nodeAsString(bookmark2.internalElement());
- return deepCompareDomNodes(bookmark1.internalElement(), bookmark2.internalElement());
-}
-
-static void cloneBookmarkContents(const KBookmark &target, const KBookmark &source)
-{
- const QDomElement targetEl = target.internalElement();
- QDomNode parent = targetEl.parentNode();
- QDomNode clonedNode = source.internalElement().cloneNode(true);
- parent.replaceChild(clonedNode, targetEl);
-}
-
-static KBookmark cloneBookmark(const KBookmark &toClone)
-{
- const QDomNode cloned = toClone.internalElement().cloneNode(true);
- return KBookmark(cloned.toElement());
-}
-
-static void emptyBookmarkGroup(KBookmarkGroup &root)
-{
- KBookmark bookmark = root.first();
- while (!bookmark.isNull()) {
- KBookmark bookmarkToRemove = bookmark;
- bookmark = root.next(bookmark);
- root.deleteBookmark(bookmarkToRemove);
- }
-}
-
-static int bookmarkGroupSize(KBookmarkGroup &root)
-{
- int count = 0;
- KBookmark bookmark = root.first();
- while (!bookmark.isNull()) {
- count++;
- bookmark = root.next(bookmark);
- }
- return count;
-}
-
-//////////////// class KFilePlacesSharedBookmarks
-
-KFilePlacesSharedBookmarks::KFilePlacesSharedBookmarks(KBookmarkManager *mgr)
-{
- m_placesBookmarkManager = mgr;
-
- // we check later if the directory exists
- const QString datadir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
- QDir().mkpath(datadir);
- const QString file = datadir + "/user-places.xbel";
- m_sharedBookmarkManager = KBookmarkManager::managerForExternalFile(file);
-
- connect(m_sharedBookmarkManager, SIGNAL(changed(QString,QString)),
- this, SLOT(slotSharedBookmarksChanged()));
- connect(m_sharedBookmarkManager, SIGNAL(bookmarksChanged(QString)),
- this, SLOT(slotSharedBookmarksChanged()));
-
- integrateSharedBookmarks();
-}
-
-bool KFilePlacesSharedBookmarks::integrateSharedBookmarks()
-{
- KBookmarkGroup root = m_placesBookmarkManager->root();
- KBookmark bookmark = root.first();
-
- KBookmarkGroup sharedRoot = m_sharedBookmarkManager->root();
- KBookmark sharedBookmark = sharedRoot.first();
-
- bool dirty = false;
-
- while (!bookmark.isNull()) {
- //qDebug() << "importing" << bookmark.text();
-
- // skip over system items
- if (bookmark.metaDataItem("isSystemItem") == "true") {
- bookmark = root.next(bookmark);
- continue;
- }
-
- // do the bookmarks match?
- if (!sharedBookmark.isNull() && compareBookmarks(bookmark, sharedBookmark)) {
- //qDebug() << "excat comparing: targetbk:\n" << nodeAsString(bookmark.internalElement()) << "\nsourcbk:\n" << nodeAsString(sharedBookmark.internalElement());
-
- if (!exactCompareBookmarks(bookmark, sharedBookmark)) {
- KBookmark cloneTarget = bookmark;
- KBookmark cloneSource = sharedBookmark;
-
- sharedBookmark = sharedRoot.next(sharedBookmark);
- bookmark = root.next(bookmark);
-
- //qDebug() << "cloning" << cloneSource.text();
- //qDebug() << "cloning: target=\n" << nodeAsString(cloneTarget.internalElement()) << "\n source:\n" << nodeAsString(cloneSource.internalElement());
-
- cloneBookmarkContents(cloneTarget, cloneSource);
- dirty = true;
- continue;
- } else {
- //qDebug() << "keeping" << bookmark.text();
- }
- sharedBookmark = sharedRoot.next(sharedBookmark);
- bookmark = root.next(bookmark);
- continue;
- }
-
- // they don't match -> remove
- //qDebug() << "removing" << bookmark.text();
- KBookmark bookmarkToRemove = bookmark;
- bookmark = root.next(bookmark);
- root.deleteBookmark(bookmarkToRemove);
-
- dirty = true;
- }
-
- // append the remaining shared bookmarks
- while (!sharedBookmark.isNull()) {
- root.addBookmark(cloneBookmark(sharedBookmark));
- sharedBookmark = sharedRoot.next(sharedBookmark);
- dirty = true;
- }
-
- return dirty;
-}
-
-bool KFilePlacesSharedBookmarks::exportSharedBookmarks()
-{
- KBookmarkGroup root = m_placesBookmarkManager->root();
- KBookmark bookmark = root.first();
|
[-]
[+]
|
Deleted |
kio-5.9.0.tar.xz/src/filewidgets/kfileplacessharedbookmarks_p.h
^
|
@@ -1,57 +0,0 @@
-/* This file is part of the KDE project
- Copyright (C) 2008 Norbert Frese <nf2@scheinwelt.at>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License version 2 as published by the Free Software Foundation.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-
-*/
-
-#ifndef KFILEPLACESSHAREDBOOKMARKS_P_H
-#define KFILEPLACESSHAREDBOOKMARKS_P_H
-
-#include <QtCore/QObject>
-#include <kbookmarkmanager.h>
-
-/**
- * keeps the KFilePlacesModel bookmarks and the shared bookmark spec
- * shortcuts in sync
- */
-class KFilePlacesSharedBookmarks : public QObject
-{
- Q_OBJECT
-public:
-
- KFilePlacesSharedBookmarks(KBookmarkManager *mgr);
- ~KFilePlacesSharedBookmarks()
- {
- /* delete m_sharedBookmarkManager; */
- }
-
- void updateSharedBookmarks();
-
-private:
-
- bool integrateSharedBookmarks();
- bool exportSharedBookmarks();
-
- KBookmarkManager *m_placesBookmarkManager;
- KBookmarkManager *m_sharedBookmarkManager;
-
-private Q_SLOTS:
-
- void slotSharedBookmarksChanged();
-
-};
-
-#endif /*KFILEPLACESSHARED_P_H_*/
|
[-]
[+]
|
Changed |
kio.yaml
^
|
@@ -1,5 +1,5 @@
Name : kio
-Version : 5.9.0
+Version : 5.10.0
Release : 2
Group : System/Base
License : GPLv2+
|