]> Git trees. - libqmvoc.git/commitdiff
put *.txt khangman files in khangman/data where they belong after kns download
authorJeremy Paul Whiting <jpwhiting@kde.org>
Tue, 25 Sep 2007 13:17:38 +0000 (13:17 +0000)
committerJeremy Paul Whiting <jpwhiting@kde.org>
Tue, 25 Sep 2007 13:17:38 +0000 (13:17 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=716875

keduvocdocument/sharedkvtmlfiles.cpp

index 8ff877476061ca1e1707c4b569a417e042d08daa..624913d7a31733ba1bf05cf6d4d334ab6e4e95da 100644 (file)
@@ -182,6 +182,18 @@ void SharedKvtmlFiles::sortDownloadedFiles()
         // take off the one we just did
         unsortedFiles.removeFirst();
     }
+    
+    QStringList khangmanFiles = KGlobal::dirs()->findAllResources( "data", 
+                                QString( "kvtml/*.txt" ) );
+    
+    // move khangman files into
+    while ( !khangmanFiles.isEmpty() ) {
+        KUrl fileUrl( KUrl::fromPath( khangmanFiles.first() ) );
+        KUrl destDir = KUrl::fromPath(KStandardDirs::locateLocal("appdata", "khangman/data/"));
+        // do this better with KStandardDirs stuff
+        KIO::move( fileUrl, destDir);
+        khangmanFiles.removeFirst();
+    }
 
     rescan();
 }