コード例 #1
0
void ThumbView::slImageChanged( KFileItem *kfit )
{
   if( ! kfit ) return;
   // kdDebug(28000) << "changes to one thumbnail!" << endl;

   KURL thumbDir = currentDir();
   KURL itemUrl = kfit->url();

   /* delete filename */
   itemUrl.setFileName( QString());
   if( !itemUrl.equals( thumbDir, true ))
   {
      // kdDebug(28000) << "returning, because directory does not match: " << itemUrl.prettyURL() << endl;
      // kdDebug(28000) << "and my URL: " << thumbDir.prettyURL() << endl;
      return;
   }

   if( deleteImage( kfit ))
   {
      kdDebug(28000) << "was changed, deleted first!" << endl;
   }
   /* Trigger a new reading */
   KFileItemList li;
   li.append( kfit );
   slNewFileItems( li );
}
コード例 #2
0
bool RKWorkplace::openScriptEditor (const KURL &url, bool use_r_highlighting, bool read_only, const QString &force_caption) {
	RK_TRACE (APP);

// is this url already opened?
	if (!url.isEmpty ()) {
		for (RKWorkplaceObjectList::const_iterator it = windows.constBegin (); it != windows.constEnd (); ++it) {
			if ((*it)->type == RKMDIWindow::CommandEditorWindow) {
				KURL ourl = static_cast<RKCommandEditorWindow *> (*it)->url ();
				if (url.equals (ourl, true)) {
					(*it)->activate ();
					return true;
				}
			}
		}
	}

	RKCommandEditorWindow *editor = new RKCommandEditorWindow (view (), use_r_highlighting);

	if (!url.isEmpty ()) {
		if (!editor->openURL (url, use_r_highlighting, read_only)) {
			delete editor;
			KMessageBox::messageBox (view (), KMessageBox::Error, i18n ("Unable to open \"%1\"").arg (url.prettyURL ()), i18n ("Could not open command file"));
			return false;
		}
	}

	if (!force_caption.isEmpty ()) editor->setCaption (force_caption);
	addWindow (editor);
	return true;
}
コード例 #3
0
ファイル: tdefiletreebranch.cpp プロジェクト: Fat-Zer/tdelibs
void KFileTreeBranch::slotRedirect( const KURL& oldUrl, const KURL&newUrl )
{
    if( oldUrl.equals( m_startURL, true ))
    {
        m_startURL = newUrl;
    }
}
コード例 #4
0
QString ProxyScout::proxyForURL(const KURL &url)
{
    if(m_suspendTime)
    {
        if(std::time(0) - m_suspendTime < 300)
            return "DIRECT";
        m_suspendTime = 0;
    }

    // Never use a proxy for the script itself
    if(m_downloader && url.equals(m_downloader->scriptURL(), true))
        return "DIRECT";

    if(m_script)
        return handleRequest(url);

    if(m_downloader || startDownload())
    {
        m_requestQueue.append(url);
        return QString::null;
    }
    else
        return "DIRECT";
}