Summary: | Hide password in the quick connect dialog | ||
---|---|---|---|
Product: | [Applications] kftpgrabber | Reporter: | LuRan <hephooey_dev> |
Component: | general | Assignee: | Jernej Kos <kostko> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
LuRan
2006-09-14 06:51:17 UTC
SVN commit 599327 by kostko: Hide passwords from recent site list in quick connect dialog. BUG: 134049 M +15 -5 quickconnect.cpp M +5 -1 quickconnect.h --- trunk/extragear/network/kftpgrabber/src/widgets/quickconnect.cpp #599326:599327 @@ -86,7 +86,7 @@ connect(m_layout->passwordBox, SIGNAL(textChanged(const QString&)), this, SLOT(slotPassChanged())); connect(m_layout->portBox, SIGNAL(valueChanged(int)), this, SLOT(slotPortChanged(int))); connect(m_layout->anonLogin, SIGNAL(clicked()), this, SLOT(slotAnonClicked())); - connect(m_layout->recentConnections, SIGNAL(activated(const QString&)), this, SLOT(slotRecentConnectionActivated(const QString&))); + connect(m_layout->recentConnections, SIGNAL(activated(int)), this, SLOT(slotRecentConnectionActivated(int))); // Init url m_url.setProtocol("ftp"); @@ -110,8 +110,16 @@ m_layout->serverEncoding->setCurrentText(defEncoding); // Populate recent sites - m_layout->recentConnections->insertStringList(KFTPCore::Config::recentSites()); - slotRecentConnectionActivated(KFTPCore::Config::recentSites().first()); + int index = 0; + QStringList recentSites = KFTPCore::Config::recentSites(); + for (QStringList::Iterator i = recentSites.begin(); i != recentSites.end(); ++i) { + KURL siteUrl = KURL(*i); + + m_recentSites[index] = siteUrl; + m_layout->recentConnections->insertItem(siteUrl.prettyURL(), index++); + } + + slotRecentConnectionActivated(0); } QuickConnectDialog::~QuickConnectDialog() @@ -120,9 +128,10 @@ delete m_protocolAdvancedDialog; } -void QuickConnectDialog::slotRecentConnectionActivated(const QString &url) +void QuickConnectDialog::slotRecentConnectionActivated(int index) { - m_layout->urlBox->setText(url); + KURL url = m_recentSites[index]; + m_layout->urlBox->setText(url.url()); if (m_url.user() == "anonymous") { m_layout->anonLogin->setChecked(true); @@ -182,6 +191,7 @@ m_layout->portBox->setValue(m_url.port()); } + m_layout->urlBox->setText(m_url.prettyURL()); m_noUrlChange = false; } --- trunk/extragear/network/kftpgrabber/src/widgets/quickconnect.h #599326:599327 @@ -39,6 +39,8 @@ #include "kftpquickconnectlayout.h" +#include <qmap.h> + #include <kdialogbase.h> #include <kurl.h> @@ -138,6 +140,8 @@ Bookmarks::BookmarkEditorTLS *m_protocolAdvancedDialog; bool m_portChanged; + + QMap<int, KURL> m_recentSites; private slots: virtual void slotOk(); @@ -149,7 +153,7 @@ void slotAnonClicked(); void slotProtocolChanged(int); void slotProtoAdvancedClicked(); - void slotRecentConnectionActivated(const QString &url); + void slotRecentConnectionActivated(int index); }; } |