X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5252c12db4929886dbe502013e0a1fee6500f568..bbc814c7fa79b545ceef3e6f7eaf00398eef896c:/src/protocolcombo.cpp diff --git a/src/protocolcombo.cpp b/src/protocolcombo.cpp index b91b102cd..729102973 100644 --- a/src/protocolcombo.cpp +++ b/src/protocolcombo.cpp @@ -14,40 +14,44 @@ * 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 +#include #include #include +#include #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); QStringList::iterator it = m_protocols.begin(); QStringList::iterator itEnd = m_protocols.end(); - Q3PopupMenu* menu = new Q3PopupMenu(this); + QMenu* menu = new QMenu(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) + + // DF: why not just supportsListing? + 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 +73,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 +104,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); /* */