[Kst] branches/work/kst/kst1kde4/kst/src/libkstapp

Zongyi Zhang freebody.kst at gmail.com
Thu Apr 15 20:11:02 CEST 2010


SVN commit 1115241 by zhang:

continue kst1kde4

 M  +12 -16    kstdoc.cpp  


--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstdoc.cpp #1115240:1115241
@@ -190,24 +190,19 @@
   }
 
   QString tmpFile;
-/* xxx
-  if (url.isLocalFile() || url.protocol().isEmpty()) {
+
+  if (url.scheme() == "file" || url.isRelative()) {
     tmpFile = url.path();
   } else {
-    if (!KIO::NetAccess::exists(url, true, KstApp::inst())) {
-      QMessageBox::warning(KstApp::inst(), QObject::tr("kst"), QObject::tr("%1: There is no file with that name to open.").arg(url.prettyURL()));
+/*    if (!KIO::NetAccess::exists(url, true, KstApp::inst()) || !KIO::NetAccess::download(url, tmpFile, KstApp::inst())) {
+      QMessageBox::warning(KstApp::inst(), QObject::tr("kst"), QObject::tr("%1: There is no file with that name to open.").arg(url.path()));
 
       return false;
     }
 
-    if (!KIO::NetAccess::download(url, tmpFile, KstApp::inst())) {
-      QMessageBox::warning(KstApp::inst(), QObject::tr("kst"), QObject::tr("%1: There is no file with that name to open.").arg(url.prettyURL()));
-
-      return false;
-    }
-    cleanupFile = true;
+    cleanupFile = true;  */
   }
-*/
+
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   opening = true;
 
@@ -231,14 +226,15 @@
 
     return false;
   }
-/* xxx
-  _title = url.fileName(false);
-  _absFilePath = url.url();
-  _lastFilePath = url.url();
+
+  QFileInfo fi(url.path());
+  _title = fi.fileName();
+  _absFilePath = url.toEncoded();
+  _lastFilePath = url.toEncoded();
   if (_title.isEmpty()) {
     _title = _absFilePath;
   }
-*/
+
   QDomDocument doc(_title);
 
   if (!f.open(QIODevice::ReadOnly)) {


More information about the Kst mailing list