当前位置: 首页>>代码示例>>C++>>正文


C++ KUrl::queryItem方法代码示例

本文整理汇总了C++中KUrl::queryItem方法的典型用法代码示例。如果您正苦于以下问题:C++ KUrl::queryItem方法的具体用法?C++ KUrl::queryItem怎么用?C++ KUrl::queryItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KUrl的用法示例。


在下文中一共展示了KUrl::queryItem方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: listDir

void FileNameSearchProtocol::listDir(const KUrl& url)
{
    cleanup();

    m_checkContent = url.queryItem("checkContent");

    m_literal = url.queryItem("literal");

    m_checkType = url.queryItem("checkType");


    QString search = url.queryItem("search");
    if (!search.isEmpty() && m_literal == "yes") {
        search = QRegExp::escape(search);
    }

    if (!search.isEmpty()) {
        m_regExp = new QRegExp(search, Qt::CaseInsensitive);
    }

    const QString urlString = url.queryItem("url");
    searchDirectory(KUrl(urlString));

    cleanup();
    finished();
}
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:26,代码来源:filenamesearchprotocol.cpp

示例2: onAnnounceResult

	void HTTPTracker::onAnnounceResult(const KUrl& url, const QByteArray& data, KJob* j)
	{
		timer.stop();
		active_job = 0;
		if (j->error() && data.size() == 0)
		{
			QString err = error;
			error.clear();
			if (err.isEmpty())
				err = j->errorString();

			Out(SYS_TRK | LOG_IMPORTANT) << "Error : " << err << endl;
			if (url.queryItem("event") != "stopped")
			{
				failures++;
				failed(err);
			}
			else
			{
				status = TRACKER_IDLE;
				stopDone();
			}
		}
		else
		{
			if (url.queryItem("event") != "stopped")
			{
				try
				{
					if (updateData(data))
					{
						failures = 0;
						peersReady(this);
						request_time = QDateTime::currentDateTime();
						status = TRACKER_OK;
						if (url.queryItem("event") == "started")
							started = true;
						if (started)
							reannounce_timer.start(interval * 1000);
						requestOK();
					}
				}
				catch (bt::Error & err)
				{
					failures++;
					failed(i18n("Invalid response from tracker"));
				}
				event = QString();
			}
			else
			{
				status = TRACKER_IDLE;
				failures = 0;
				stopDone();
			}
		}
		doAnnounceQueue();
	}
开发者ID:ashl1,项目名称:libktorrent-stream,代码行数:58,代码来源:httptracker.cpp

示例3: connect

Playdar::ProxyResolver::ProxyResolver( Collections::PlaydarCollection *collection,
                                       const KUrl &url, MetaProxy::TrackPtr track )
    : m_collection( collection )
    , m_proxyTrack( track )
    , m_controller( new Playdar::Controller( true ) )
    , m_query()
{
    connect( m_controller, SIGNAL(playdarError(Playdar::Controller::ErrorState)),
             this, SLOT(slotPlaydarError(Playdar::Controller::ErrorState)) );
    connect( m_controller, SIGNAL(queryReady(Playdar::Query*)),
             this, SLOT(collectQuery(Playdar::Query*)) );
    m_controller->resolve( url.queryItem( "artist" ),
                           url.queryItem( "album" ),
                           url.queryItem( "title" ) );
}
开发者ID:cancamilo,项目名称:amarok,代码行数:15,代码来源:ProxyResolver.cpp

示例4: findUrlForAccount

 static KUrl findUrlForAccount( const KMail::ImapAccountBase * a ) {
   assert( a );
   const SieveConfig sieve = a->sieveConfig();
   if ( !sieve.managesieveSupported() )
     return KUrl();
   if ( sieve.reuseConfig() ) {
     // assemble Sieve url from the settings of the account:
     KUrl u;
     u.setProtocol( "sieve" );
     u.setHost( a->host() );
     u.setUser( a->login() );
     u.setPass( a->passwd() );
     u.setPort( sieve.port() );
     u.addQueryItem( "x-mech", a->auth() == "*" ? "PLAIN" : a->auth() ); //translate IMAP LOGIN to PLAIN
     if ( !a->useSSL() && !a->useTLS() )
       u.addQueryItem( "x-allow-unencrypted", "true" );
     u.setFileName( sieve.vacationFileName() );
     return u;
   } else {
     KUrl u = sieve.alternateURL();
     if ( u.protocol().toLower() == "sieve" && !a->useSSL() && !a->useTLS() && u.queryItem("x-allow-unencrypted").isEmpty() )
       u.addQueryItem( "x-allow-unencrypted", "true" );
     u.setFileName( sieve.vacationFileName() );
     return u;
   }
 }
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:26,代码来源:vacation.cpp

示例5: post

    void TorrentPostHandler::post(HttpClientHandler* hdlr, const QHttpRequestHeader& hdr, const QByteArray& data)
    {
        const char* ptr = data.data();
        int len = data.size();
        int pos = QString(data).indexOf("\r\n\r\n");

        if (pos == -1 || pos + 4 >= len)
        {
            HttpResponseHeader rhdr(500);
            server->setDefaultResponseHeaders(rhdr, "text/html", false);
            hdlr->send500(rhdr, i18n("Invalid data received"));
            return;
        }

        // save torrent to a temporary file
        QString save_file = kt::DataDir() + "webgui_load_torrent";
        QFile tmp_file(save_file);

        if (!tmp_file.open(QIODevice::WriteOnly))
        {
            HttpResponseHeader rhdr(500);
            server->setDefaultResponseHeaders(rhdr, "text/html", false);
            hdlr->send500(rhdr, i18n("Failed to open temporary file"));
            return;
        }

        QDataStream out(&tmp_file);
        out.writeRawData(ptr + (pos + 4), len - (pos + 4));
        tmp_file.close();

        Out(SYS_WEB | LOG_NOTICE) << "Loading file " << save_file << endl;
        core->loadSilently(KUrl(save_file), QString());

        KUrl url;
        url.setEncodedPathAndQuery(hdr.path());
        QString page = url.queryItem("page");
        // there needs to be a page to send back
        if (page.isEmpty())
        {
            server->redirectToLoginPage(hdlr);
        }
        else
        {
            // redirect to page mentioned in page parameter
            HttpResponseHeader rhdr(301);
            server->setDefaultResponseHeaders(rhdr, "text/html", true);
            rhdr.setValue("Location", "/" + page);
            hdlr->send(rhdr, QByteArray());
        }
    }
开发者ID:biwin,项目名称:ktorrent,代码行数:50,代码来源:torrentposthandler.cpp

示例6: shouldStartNewJob

bool AllNotesListJob::shouldStartNewJob(const KUrl &prev, const KUrl &next)
{
    Q_UNUSED(next);
    Q_D(AllNotesListJob);
    const QString since = prev.queryItem("since");
    if (since.isEmpty()) {
        kDebug() << "Aborting notes fetching, no date range found in URL!";
        return false;
    }
    KDateTime sinceTime;
    sinceTime.setTime_t(since.toLongLong());
    if (!sinceTime.isValid()) {
        kDebug() << "Aborting notes fetching, invalid date range found in URL!";
        return false;
    }

    return (sinceTime >= d->lowerLimit);
}
开发者ID:KDE,项目名称:libkfbapi,代码行数:18,代码来源:allnoteslistjob.cpp

示例7: decode

static void decode(const KUrl &url, Misc::TFont &font, bool &system)
{
    font=FC::decode(url);
    system=url.queryItem("sys")=="true";
}
开发者ID:fluxer,项目名称:kde-workspace,代码行数:5,代码来源:JobRunner.cpp


注:本文中的KUrl::queryItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。