rpms/kdelibs/F-11 kdelibs-4.3.1-copyrename.patch, NONE, 1.1 kdelibs.spec, 1.490, 1.491
Lukas Tinkl
ltinkl at fedoraproject.org
Tue Aug 18 12:02:43 UTC 2009
Author: ltinkl
Update of /cvs/extras/rpms/kdelibs/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22560/F-11
Modified Files:
kdelibs.spec
Added Files:
kdelibs-4.3.1-copyrename.patch
Log Message:
backport fix for KDE bug #195385
kdelibs-4.3.1-copyrename.patch:
kio/kfileitem.cpp | 3 +++
tests/kdirmodeltest.cpp | 6 ++++++
tests/kfileitemtest.cpp | 15 +++++++++++++++
tests/kfileitemtest.h | 1 +
4 files changed, 25 insertions(+)
--- NEW FILE kdelibs-4.3.1-copyrename.patch ---
Index: kio/kio/kfileitem.cpp
===================================================================
--- kio/kio/kfileitem.cpp (revision 1012563)
+++ kio/kio/kfileitem.cpp (revision 1012564)
@@ -532,6 +532,9 @@
{
d->m_strName = name;
d->m_strText = KIO::decodeFileName( d->m_strName );
+ if (d->m_entry.contains(KIO::UDSEntry::UDS_NAME))
+ d->m_entry.insert(KIO::UDSEntry::UDS_NAME, d->m_strName); // #195385
+
}
QString KFileItem::linkDest() const
Index: kio/tests/kfileitemtest.cpp
===================================================================
--- kio/tests/kfileitemtest.cpp (revision 1012563)
+++ kio/tests/kfileitemtest.cpp (revision 1012564)
@@ -241,6 +241,21 @@
QVERIFY(fileItem.cmp(fileItem2));
}
+void KFileItemTest::testRename()
+{
+ KIO::UDSEntry entry;
+ const QString origName = QString::fromLatin1("foo");
+ entry.insert(KIO::UDSEntry::UDS_NAME, origName);
+ entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
+ KFileItem fileItem(entry, KUrl("/dir/foo"));
+ QCOMPARE(fileItem.name(), origName);
+ QCOMPARE(fileItem.text(), origName);
+ const QString newName = QString::fromLatin1("FiNeX_rocks");
+ fileItem.setName(newName);
+ QCOMPARE(fileItem.name(), newName);
+ QCOMPARE(fileItem.text(), newName);
+ QCOMPARE(fileItem.entry().stringValue(KIO::UDSEntry::UDS_NAME), newName); // #195385
+}
void KFileItemTest::testDecodeFileName_data()
{
Index: kio/tests/kdirmodeltest.cpp
===================================================================
--- kio/tests/kdirmodeltest.cpp (revision 1012563)
+++ kio/tests/kdirmodeltest.cpp (revision 1012564)
@@ -418,6 +418,12 @@
// check renaming happened
QCOMPARE( m_dirModel->itemForIndex( m_secondFileIndex ).url().url(), newUrl.url() );
+ // check that KDirLister::cachedItemForUrl won't give a bad name if copying that item (#195385)
+ KFileItem cachedItem = KDirLister::cachedItemForUrl(newUrl);
+ Q_ASSERT(!cachedItem.isNull());
+ QCOMPARE(cachedItem.name(), QString("toplevelfile_2_renamed"));
+ QCOMPARE(cachedItem.entry().stringValue(KIO::UDSEntry::UDS_NAME), QString("toplevelfile_2_renamed"));
+
// Put things back to normal
job = KIO::rename(newUrl, url, KIO::HideProgressInfo);
ok = job->exec();
Index: kio/tests/kfileitemtest.h
===================================================================
--- kio/tests/kfileitemtest.h (revision 1012563)
+++ kio/tests/kfileitemtest.h (revision 1012564)
@@ -35,6 +35,7 @@
void testHiddenFile();
void testMimeTypeOnDemand();
void testCmp();
+ void testRename();
void testDecodeFileName_data();
void testDecodeFileName();
Index: kdelibs.spec
===================================================================
RCS file: /cvs/extras/rpms/kdelibs/F-11/kdelibs.spec,v
retrieving revision 1.490
retrieving revision 1.491
diff -u -p -r1.490 -r1.491
--- kdelibs.spec 17 Aug 2009 12:18:19 -0000 1.490
+++ kdelibs.spec 18 Aug 2009 12:02:43 -0000 1.491
@@ -4,7 +4,7 @@
Summary: K Desktop Environment 4 - Libraries
Version: 4.3.0
-Release: 4%{?dist}
+Release: 5%{?dist}
%if 0%{?fedora} > 8
Name: kdelibs
@@ -90,6 +90,8 @@ Patch101: kdelibs-4.3.1-kdebug#199557.pa
Patch102: kdelibs-4.3.1-unmountfix.patch
# http://bugs.kde.org/170608
Patch103: kdelibs-4.3.1-copyurls.patch
+# http://bugs.kde.org/195385
+Patch104: kdelibs-4.3.1-copyrename.patch
BuildRequires: qt4-devel >= 4.5.0
# qt4%{_?_isa} isn't provided yet -- Rex
@@ -228,6 +230,7 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{versi
%patch101 -p4 -b .kdebug#199557
%patch102 -p0 -b .unmountfix
%patch103 -p0 -b .copyurls
+%patch104 -p0 -b .copyrename
%build
@@ -409,6 +412,9 @@ rm -rf %{buildroot}
%changelog
+* Tue Aug 18 2009 Lukáš Tinkl <ltinkl at redhat.com> - 4.3.0.5
+- fix KDE bug #19538, copy file after rename uses old file name
+
* Mon Aug 17 2009 Lukáš Tinkl <ltinkl at redhat.com> - 4.3.0-4
- fix unmounting devices
- fix copying URLs to clipboard (kdebug:170608)
More information about the fedora-extras-commits
mailing list