File kdelibs_http_offline_mode.diff of Package kdelibs3

Index: kio/kio/global.cpp
===================================================================
--- kio/kio/global.cpp	(revision 513387)
+++ kio/kio/global.cpp	(working copy)
@@ -408,6 +408,9 @@
     case KIO::ERR_POST_DENIED:
       result = i18n( "Access to restricted port in POST denied.");
       break;
+    case KIO::ERR_OFFLINE_MODE:
+      result = i18n( "Could not access %1.\nOffline mode active.").arg( errorText ); 
+      break;
     default:
       result = i18n( "Unknown error code %1\n%2\nPlease send a full bug report at http://bugs.kde.org." ).arg( errorCode ).arg( errorText );
       break;
Index: kio/kio/global.h
===================================================================
--- kio/kio/global.h	(revision 513387)
+++ kio/kio/global.h	(working copy)
@@ -244,8 +244,10 @@
     ERR_UPGRADE_REQUIRED = 64, // A transport upgrade is required to access this
                                // object.  For instance, TLS is demanded by
                                // the server in order to continue.
-    ERR_POST_DENIED = 65    // Issued when trying to POST data to a certain Ports
+    ERR_POST_DENIED = 65,      // Issued when trying to POST data to a certain Ports
                                // see job.cpp
+    ERR_OFFLINE_MODE = 66      // Used when an app is in offline mode and a 
+                               // requested document is unavailable.
   };
 
   /**
Index: kioslave/http/http.cc
===================================================================
--- kioslave/http/http.cc	(revision 513387)
+++ kioslave/http/http.cc	(working copy)
@@ -2205,6 +2205,11 @@
         // Conditional cache hit. (Validate)
      }
 
+     if (bCacheOnly/* && bOffline*/)
+     {
+        error( ERR_OFFLINE_MODE, m_request.url.url() );
+        return false;
+     }
      if (bCacheOnly)
      {
         error( ERR_DOES_NOT_EXIST, m_request.url.url() );
openSUSE Build Service is sponsored by