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

List:       kde-commits
Subject:    kdeutils/kfloppy
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2005-01-01 16:51:08
Message-ID: 20050101165108.A02AF1CE93 () office ! kde ! org
[Download RAW message or body]

CVS commit by goutte: 

Process two error messages of fdformat
(Especially useful, as one of the errors is typical for a failed verify.)
(Linux only)
CCBUG:87637


  M +17 -2     format.cpp   1.25


--- kdeutils/kfloppy/format.cpp  #1.24:1.25
@@ -483,8 +483,23 @@ void FDFormat::processStdOut(KProcess *,
         DEBUGS(s);
         QRegExp regexp( "([0-9]+)" );
-        if ( regexp.search(s) > -1 )
+        if (s.startsWith("bad data at cyl") || s.startsWith("Problem reading cylinder"))
+        {
+            const int track = regexp.cap(1).toInt();
+            if (track>=0)
         {
+                emit status(i18n("Low-level formatting error at track %1!").arg(track), -1);
+            }
+            else
+            {
+                // This error should not happen
+                emit status(i18n("Low-level formatting error: %1").arg(s), -1);
+            }
+            return;
+        }
+        else if ( regexp.search(s) > -1 )
+        {
+            // Normal track number (formatting or verifying)
             const int p = regexp.cap(1).toInt();
-            if ((p>0) && (p<deviceInfo->tracks))
+            if ((p>=0) && (p<deviceInfo->tracks))
             {
                     emit status(QString::null,


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

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