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);
}
예제 #2
0
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;
}
예제 #3
0
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;
}
예제 #4
0
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;
    }
}
예제 #5
0
void SiteSettings::setUrl(const KURL& url)
{
  mUrl = url.pathOrURL();
}
예제 #6
0
void SiteSettings::setDefaultFile(const KURL& defaultFile)
{
  mDefaultFile = defaultFile.pathOrURL();
}
예제 #7
0
void SiteSettings::setRemoteBaseDir(const KURL& remoteBaseDir)
{
  mRemoteBaseDir = remoteBaseDir.pathOrURL();
}
예제 #8
0
void SiteSettings::setLocalBaseDir(const KURL& localBaseDir)
{
  mLocalBaseDir = localBaseDir.pathOrURL();
}