void SiteSettingsDialog::populate(const QString& name, const KURL& url, const KURL& remoteBaseDir, const KURL& localBaseDir, const KURL& defaultFile, const QString& debuggerName, QMap<QString,QString>& mappings) { m_edName->setText(name); m_edUrl->setText(url.url()); m_edRemoteBaseDir->setText(remoteBaseDir.pathOrURL()); m_edLocalBaseDir->setURL(localBaseDir.pathOrURL()); m_edDefaultFile->setURL(defaultFile.pathOrURL()); QMap<QString, QString>::iterator it; QString dlabel; for(it = m_debuggerMap.begin(); it != m_debuggerMap.end(); ++it) { if(it.data() == debuggerName) { dlabel = it.key(); break; } } if(!dlabel.isEmpty()) { m_cbDebuggerName->setCurrentText(dlabel); } m_mappingWidget->setMappings(mappings); }
void SiteSettings::load(const QString& name, const KURL& url, const KURL& remoteBaseDir, const KURL& localBaseDir, const KURL& defaultFile, /*bool matchFileInLowerCase,*/ const QString& debuggerClient, const QMap<QString,QString>& maps) { mName = name; mUrl = url.url(); mRemoteBaseDir = remoteBaseDir.pathOrURL(); mLocalBaseDir = localBaseDir.pathOrURL(); // mMatchFileInLowerCase = matchFileInLowerCase; mDebuggerClient = debuggerClient; mDefaultFile = defaultFile.pathOrURL(); mMappings = maps; }
static KURL getNewFileName(const KURL &u, const QString &text) { bool ok; QString dialogText(text); if(dialogText.isEmpty()) dialogText = i18n("Filename for clipboard content:"); QString file = KInputDialog::getText(QString::null, dialogText, QString::null, &ok); if(!ok) return KURL(); KURL myurl(u); myurl.addPath(file); if(KIO::NetAccess::exists(myurl, false, 0)) { kdDebug(7007) << "Paste will overwrite file. Prompting..." << endl; KIO::RenameDlg_Result res = KIO::R_OVERWRITE; QString newPath; // Ask confirmation about resuming previous transfer res = Observer::self()->open_RenameDlg(0L, i18n("File Already Exists"), u.pathOrURL(), myurl.pathOrURL(), (KIO::RenameDlg_Mode)(KIO::M_OVERWRITE | KIO::M_SINGLE), newPath); if(res == KIO::R_RENAME) { myurl = newPath; } else if(res == KIO::R_CANCEL) { return KURL(); } } return myurl; }
void HTTPTracker::setupMetaData(KIO::MetaData & md) { md["UserAgent"] = "ktorrent/" VERSION; md["SendLanguageSettings"] = "false"; md["Cookies"] = "none"; // md["accept"] = "text/plain"; md["accept"] = "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"; if (Settings::doNotUseKDEProxy()) { // set the proxy if the doNotUseKDEProxy ix enabled (URL must be valid to) KURL url = KURL::fromPathOrURL(Settings::httpTrackerProxy()); if (url.isValid()) md["UseProxy"] = url.pathOrURL(); else md["UseProxy"] = QString::null; } }
void SiteSettings::setUrl(const KURL& url) { mUrl = url.pathOrURL(); }
void SiteSettings::setDefaultFile(const KURL& defaultFile) { mDefaultFile = defaultFile.pathOrURL(); }
void SiteSettings::setRemoteBaseDir(const KURL& remoteBaseDir) { mRemoteBaseDir = remoteBaseDir.pathOrURL(); }
void SiteSettings::setLocalBaseDir(const KURL& localBaseDir) { mLocalBaseDir = localBaseDir.pathOrURL(); }