]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/protocolcombo.cpp
Add libkmetadata detection and minor fixes
[dolphin.git] / src / protocolcombo.cpp
index b91b102cd0a68488991b189faa8a45c9787e5e42..94f4e359c05cc8ea5ff0e2f3e30dae39eec2c289 100644 (file)
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
 
 #include <q3popupmenu.h>
 
 #include <kdebug.h>
 #include <kprotocolinfo.h>
+#include <kprotocolmanager.h>
 
 #include "protocolcombo.h"
 
 const static int customProtocolIndex = 0;
 
-ProtocolCombo::ProtocolCombo(const QString& protocol, URLNavigator* parent)
-    : URLNavigatorButton(-1, parent),
+ProtocolCombo::ProtocolCombo(const QString& protocol, UrlNavigator* parent)
+    : UrlNavigatorButton(-1, parent),
       m_protocols(KProtocolInfo::protocols())
 {
     qSort(m_protocols);
@@ -36,18 +37,18 @@ ProtocolCombo::ProtocolCombo(const QString& protocol, URLNavigator* parent)
     Q3PopupMenu* menu = new Q3PopupMenu(this);
     while (it != itEnd)
     {
-        //kdDebug() << "info for " << *it << " "
+        //kDebug() << "info for " << *it << " "
         //          << KProtocolInfo::protocolClass(*it) << endl;
         //TODO: wow this is ugly. or .. is it? ;) we need a way to determine
         //      if a protocol is appropriate for use in a file manager. hum!
         //if (KProtocolInfo::capabilities(*it).findIndex("filemanager") == -1)
         if (KProtocolInfo::protocolClass(*it) == ":" ||
-            !KProtocolInfo::supportsWriting(*it))
+            !KProtocolManager::supportsWriting(*it))
         {
-        //kdDebug() << "!!! removing " << *it << endl;
+        //kDebug() << "!!! removing " << *it << endl;
             QStringList::iterator tempIt = it;
             ++tempIt;
-            m_protocols.remove(it);
+            m_protocols.erase(it);
             it = tempIt;
         }
         else
@@ -69,7 +70,7 @@ ProtocolCombo::ProtocolCombo(const QString& protocol, URLNavigator* parent)
     //menu->insertItems(m_protocols);
     connect(menu, SIGNAL(activated(int)), this, SLOT(setProtocol(int)));
     setText(protocol);
-    setPopup(menu);
+    setMenu(menu);
     setFlat(true);
 }
 
@@ -100,7 +101,7 @@ void ProtocolCombo::setProtocol(int index)
     }
 
     QString protocol = m_protocols[index];
-kdDebug() << "setProtocol " << index << " " << protocol << endl;
+kDebug() << "setProtocol " << index << " " << protocol << endl;
     setText(protocol);
     emit activated(protocol);
 /*    */