[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:       2004-12-30 16:30:38
Message-ID: 20041230163038.C60FD1CF86 () office ! kde ! org
[Download RAW message or body]

CVS commit by goutte: 

- Avoid using QString::latin1 with kdDebug
- Give an error message if fdformat returns with a "ioctl" error
- Remove one "goto"


  M +18 -15    format.cpp   1.22


--- kdeutils/kfloppy/format.cpp  #1.21:1.22
@@ -466,5 +466,9 @@ void FDFormat::processStdOut(KProcess *,
                 if (s.contains("ioctl(FD_FORM)"))
                 {
-                        goto ioError;
+                    emit status (i18n(
+                            "Cannot access floppy or floppy drive.\n"
+                            "Please insert a floppy and make sure that you "
+                            "have selected a valid floppy drive."),-1);
+                    return;
                 }
                 if (s.find("/dev/")>=0)
@@ -473,8 +477,9 @@ void FDFormat::processStdOut(KProcess *,
                         return;
                 }
-                DEBUGS(s.latin1());
+                DEBUGS(s);
         }
 #elif defined(ANY_LINUX)
         s = QString::fromLatin1(b,l);
+        DEBUGS(s);
         QRegExp regexp( "([0-9]+)" );
         if ( regexp.search(s) > -1 )
@@ -487,16 +492,6 @@ void FDFormat::processStdOut(KProcess *,
             }
         }
-        else if (s.contains("ioctl(FDFMTBEG)"))
+        else if (s.find("ioctl(FDFMTBEG)")!=-1)
         {
-                goto ioError;
-        }
-        DEBUGS(s.latin1());
-#endif
-        return;
-
-// Now a bunch of (goto) labels for all the possible error messages.
-//
-//
-ioError:
         emit status (i18n(
                 "Cannot access floppy or floppy drive.\n"
@@ -504,4 +499,12 @@ ioError:
                 "have selected a valid floppy drive."),-1);
         return;
+        }
+        else if (s.find("ioctl")!=-1)
+        {
+            emit status(i18n("Low-level format error: %1").arg(s),-1);
+            return;
+        }
+#endif
+        return;
 }
 


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

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