[arch-commits] Commit in kdelibs/trunk (1012564.patch PKGBUILD)
Pierre Schmitz
pierre at archlinux.org
Tue Aug 18 11:06:16 UTC 2009
Date: Tuesday, August 18, 2009 @ 07:06:15
Author: pierre
Revision: 50005
fix bug
Added:
kdelibs/trunk/1012564.patch
Modified:
kdelibs/trunk/PKGBUILD
---------------+
1012564.patch | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PKGBUILD | 14 ++++++++---
2 files changed, 80 insertions(+), 3 deletions(-)
Added: 1012564.patch
===================================================================
--- 1012564.patch (rev 0)
+++ 1012564.patch 2009-08-18 11:06:15 UTC (rev 50005)
@@ -0,0 +1,69 @@
+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();
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-08-18 10:08:50 UTC (rev 50004)
+++ PKGBUILD 2009-08-18 11:06:15 UTC (rev 50005)
@@ -3,7 +3,7 @@
pkgname=kdelibs
pkgver=4.3.0
-pkgrel=2
+pkgrel=3
pkgdesc="KDE Core Libraries"
arch=('i686' 'x86_64')
url='http://www.kde.org'
@@ -15,11 +15,13 @@
replaces=('arts')
install='kdelibs.install'
source=(http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2
- 'kde-applications-menu.patch' 'archlinux-menu.patch' 'abs-syntax-highlight.patch')
+ 'kde-applications-menu.patch' 'archlinux-menu.patch' 'abs-syntax-highlight.patch'
+ '1012564.patch')
md5sums=('ea54f71bcbb0cf96bb6d94c019de8bb5'
'280f34ee159845f8902c31bd499254fc'
'0f214b222bfb0327e7a2b6fb13756895'
- '18ea42696a7f41332a092d6ead7efc6a')
+ '18ea42696a7f41332a092d6ead7efc6a'
+ 'e32dc06505d924d400550d7fbf30c4ce')
build() {
cd $srcdir/${pkgname}-${pkgver}
@@ -30,6 +32,12 @@
patch -p1 -i $srcdir/archlinux-menu.patch
# add syntax highlightning for PKGBUILD and .install files
patch -p1 -i $srcdir/abs-syntax-highlight.patch
+
+ # prevent possible data loss
+ # see http://bugs.kde.org/show_bug.cgi?id=195385
+ # will be included in 4.3.1
+ patch -p0 -i $srcdir/1012564.patch || return 1
+
cd ..
mkdir build
cd build
More information about the arch-commits
mailing list