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

List:       kde-commits
Subject:    kdenonbeta/kio_mhtml
From:       Spiros Georgaras <sngeorgaras () otenet ! gr>
Date:       2005-01-07 19:00:01
Message-ID: 20050107190001.E73B11B93E () office ! kde ! org
[Download RAW message or body]

CVS commit by sngeorgaras: 

browsing outside a mhtml file (by pressing the 'UP' button) always successfully leads \
to its container folder


  M +14 -8     mhtml.cc   1.5


--- kdenonbeta/kio_mhtml/mhtml.cc  #1.4:1.5
@@ -72,5 +72,5 @@ bool mhtmlProtocol::checkNewFile( const 
         if(c==-1) c=fullPath.find(".mhtml",0,FALSE);
         if(c==-1){
-                redirection( "file:" + fullPath );
+                redirection( QString::fromLatin1("file:") + fullPath );
                 finished();
                 return true;
@@ -130,10 +130,4 @@ bool mhtmlProtocol::checkNewFile( const 
                 }
         }
-//     if ( archiveFile.isEmpty() )
-//     {
-//         kdDebug() << "[mhtmlProtocol::checkNewFile]: not found" << endl;
-//         return false;
-//     }
-
         // Open new file
         kdDebug() << "[mhtmlProtocol::checkNewFile]: Opening mht file on " << \
archiveFile << endl; @@ -176,4 +170,5 @@ void mhtmlProtocol::createUDSEntry( Kmht
         atom.m_uds = UDS_ACCESS;
         atom.m_long = archFile->permissions() & 07777; // keep permissions only
+        //atom.m_long = archFile->permissions() & 05555; // show it read only 
         entry.append( atom );
     
@@ -209,4 +204,5 @@ void mhtmlProtocol::createUDSEntry( UDSE
         atom.m_uds = UDS_ACCESS;
         atom.m_long = m_mhtmlFile->permissions() & 07777; // keep permissions only
+        //atom.m_long = m_mhtmlFile->permissions() & 05555; // show it read only 
         entry.append( atom );
     
@@ -250,5 +246,6 @@ void mhtmlProtocol::listDir( const KURL 
 
         if ( path.isEmpty() ){
-                KURL redir( url.protocol() + QString::fromLatin1( ":/") );
+                //KURL redir( url.protocol() + QString::fromLatin1( ":/") );
+                KURL redir( QString::fromLatin1( "file:/") );
                 kdDebug(  ) << " -- [mhtmlProtocol::listDir]: url.path()==" << \
url.path() << endl;  redir.setPath( url.path() + QString::fromLatin1("/") );
@@ -278,4 +275,13 @@ void mhtmlProtocol::stat( const KURL & u
         QString path;
         UDSEntry entry;
+        int c=-1;
+        c=url.url().find(".mht",0,FALSE);
+        if(c==-1) c=url.url().find(".mhtml",0,FALSE);
+        if(c==-1){
+                kdDebug(  ) << "[mhtmlProtocol::stat]: redirection( \"file:\" + \
url.path() )"<< endl; +                redirection( "file:" + url.path() );
+                finished();
+                return;
+        }
         if ( !checkNewFile( url, path ) ){
                 kdDebug(  ) << "[mhtmlProtocol::stat]: url = " << url << endl;


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

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