[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [PATCH] fix for floppy: pointing to a file
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2002-07-12 21:24:58
[Download RAW message or body]

The attached patch is for the kdebase/kioslave/floppy/kio_floppy.cpp (of 
KDE_3_0_BRANCH)

The problem was that files could not be read (for example in Konqueror), while 
directories worked fine.

Problem: floppy:/ tried to search the file information on the third line of 
the ouput of mdir, my (older (3.9.7)) mtools gives it on the 4th line. As the 
third line is empty, I have changed the code so that it takes the first 
non-empty line from the third one on.

I am sorry not to be able to port the patch to CVS HEAD.

Have a nice day/evening/night!



["patch.txt" (text/plain)]

--- kio_floppy.cpp.orig	Fri Jul  5 23:10:25 2002
+++ kio_floppy.cpp	Fri Jul 12 03:59:44 2002
@@ -564,18 +564,19 @@
    QString outputString(m_stdoutBuffer);
    QTextIStream output(&outputString);
    QString line;
-   int lineNumber(0);
-   while (!output.atEnd())
+   for (int lineNumber=0;!output.atEnd();lineNumber++)
    {
       line=output.readLine();
-      if (lineNumber==3)
+      if ( (lineNumber<3) || (line.isEmpty()) )
+         continue;
+      else
       {
+        // We need line 3 (if empty, we want the first non-empty line thereafter)
          StatInfo info=createStatInfo(line,true,url.fileName());
          if (info.isValid==false)
             error( KIO::ERR_COULD_NOT_STAT, url.prettyURL()+i18n("Don't know why, sorry."));
          return info;
       };
-      lineNumber++;
    };
    if (info.isValid==false)
       error( KIO::ERR_COULD_NOT_STAT, url.prettyURL()+i18n("Don't know why, sorry."));

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic