本文整理汇总了C++中QL1S函数的典型用法代码示例。如果您正苦于以下问题:C++ QL1S函数的具体用法?C++ QL1S怎么用?C++ QL1S使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QL1S函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QObject
CaBundleUpdater::CaBundleUpdater(NetworkManager* manager, QObject* parent)
: QObject(parent)
, m_manager(manager)
, m_progress(Start)
, m_reply(0)
, m_latestBundleVersion(0)
{
m_bundleVersionFileName = DataPaths::path(DataPaths::Config) + QL1S("/certificates/bundle_version");
m_bundleFileName = DataPaths::path(DataPaths::Config) + QL1S("/certificates/ca-bundle.crt");
m_lastUpdateFileName = DataPaths::path(DataPaths::Config) + QL1S("/certificates/last_update");
// Make sure the certificates directory exists
QDir certDir(DataPaths::path(DataPaths::Config) + QL1S("/certificates"));
if (!certDir.exists())
certDir.mkpath(certDir.absolutePath());
int updateTime = 30 * 1000;
// Check immediately on first run
if (!QFile(m_lastUpdateFileName).exists()) {
updateTime = 0;
}
QTimer::singleShot(updateTime, this, SLOT(start()));
}
开发者ID:593in,项目名称:qupzilla,代码行数:25,代码来源:cabundleupdater.cpp
示例2: updateHistoryEntry
void HistoryManager::updateHistoryEntry(const KUrl &url, const QString &title)
{
QString urlString = url.url();
urlString.remove(QL1S("www."));
if(urlString.startsWith(QL1S("http")) && urlString.endsWith(QL1C('/')))
urlString.remove(urlString.length()-1,1);
for (int i = 0; i < m_history.count(); ++i)
{
QString itemUrl = m_history.at(i).url;
itemUrl.remove(QL1S("www."));
if(itemUrl.startsWith(QL1S("http")) && itemUrl.endsWith(QL1C('/')))
itemUrl.remove(itemUrl.length()-1,1);
if (urlString == itemUrl)
{
m_history[i].title = title;
m_history[i].url = url.url();
m_saveTimer->changeOccurred();
if (m_lastSavedUrl.isEmpty())
m_lastSavedUrl = m_history.at(i).url;
emit entryUpdated(i);
break;
}
}
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:27,代码来源:historymanager.cpp
示例3: QL1S
bool SessionManager::restoreYourSession(int index)
{
const QString & sessionPath = KStandardDirs::locateLocal("appdata" , QL1S("usersessions/"));
const QString & sessionName = QL1S("ses") + QString::number(index);
QDomDocument document("session");
if (!readSessionDocument(document,sessionPath + sessionName))
return false;
// trace the windows to delete
RekonqWindowList wList = rApp->rekonqWindowList();
for (unsigned int winNo = 0; winNo < document.elementsByTagName("window").length(); winNo++)
{
QDomElement window = document.elementsByTagName("window").at(winNo).toElement();
RekonqWindow *tw = rApp->newWindow();
int currentTab = loadTabs(tw, window, true, false);
tw->tabWidget()->setCurrentIndex(currentTab);
}
Q_FOREACH(const QWeakPointer<RekonqWindow> &w, wList)
{
if (!w.isNull())
w.data()->close();
}
return true;
}
开发者ID:ksarend,项目名称:rekonq,代码行数:32,代码来源:sessionmanager.cpp
示例4: msgHandler
void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
if (msg.startsWith(QL1S("QSslSocket: cannot resolve SSLv2_")))
return;
if (msg.startsWith(QL1S("Remote debugging server started successfully.")))
return;
const QByteArray localMsg = msg.toLocal8Bit();
switch (type) {
case QtDebugMsg:
case QtWarningMsg:
case QtCriticalMsg:
std::cerr << localMsg.constData();
if (context.file && context.line && context.function)
std::cerr << " (" << context.file << ":" << context.line << ", " << context.function << ")";
std::cerr << std::endl;
break;
case QtFatalMsg:
std::cerr << "Fatal: " << localMsg.constData() << std::endl;
if (context.file && context.line && context.function)
std::cerr << " (" << context.file << ":" << context.line << ", " << context.function << ")";
std::cerr << std::endl;
abort();
default:
break;
}
}
开发者ID:Acidburn0zzz,项目名称:qupzilla,代码行数:30,代码来源:main.cpp
示例5: QUrlQuery
bool AdBlockManager::addSubscriptionFromUrl(const QUrl &url)
{
const QList<QPair<QString, QString> > queryItems = QUrlQuery(url).queryItems(QUrl::FullyDecoded);
QString subscriptionTitle;
QString subscriptionUrl;
for (int i = 0; i < queryItems.count(); ++i) {
QPair<QString, QString> pair = queryItems.at(i);
if (pair.first == QL1S("location"))
subscriptionUrl = pair.second;
else if (pair.first == QL1S("title"))
subscriptionTitle = pair.second;
}
if (subscriptionTitle.isEmpty() || subscriptionUrl.isEmpty())
return false;
const QString message = AdBlockManager::tr("Do you want to add <b>%1</b> subscription?").arg(subscriptionTitle);
QMessageBox::StandardButton result = QMessageBox::question(0, AdBlockManager::tr("AdBlock Subscription"), message, QMessageBox::Yes | QMessageBox::No);
if (result == QMessageBox::Yes) {
AdBlockManager::instance()->addSubscription(subscriptionTitle, subscriptionUrl);
AdBlockManager::instance()->showDialog();
}
return true;
}
开发者ID:Martii,项目名称:qupzilla,代码行数:28,代码来源:adblockmanager.cpp
示例6: QL1S
QString Scripts::completeFormData(const QByteArray &data)
{
QString source = QL1S("(function() {"
"var data = '%1'.split('&');"
"var inputs = document.getElementsByTagName('input');"
""
"for (var i = 0; i < data.length; ++i) {"
" var pair = data[i].split('=');"
" if (pair.length != 2)"
" continue;"
" var key = decodeURIComponent(pair[0]);"
" var val = decodeURIComponent(pair[1]);"
" for (var j = 0; j < inputs.length; ++j) {"
" var input = inputs[j];"
" var type = input.type.toLowerCase();"
" if (type != 'text' && type != 'password' && type != 'email')"
" continue;"
" if (input.name == key) {"
" input.value = val;"
" input.dispatchEvent(new Event('change'));"
" }"
" }"
"}"
""
"})()");
QString d = data;
d.replace(QL1S("'"), QL1S("\\'"));
return source.arg(d);
}
开发者ID:Martii,项目名称:qupzilla,代码行数:30,代码来源:scripts.cpp
示例7: QL1S
void TabBar::setupHistoryActions()
{
MainWindow *w = Application::instance()->mainWindow();
MainView *mv = qobject_cast<MainView *>(parent());
QAction *openLastClosedTabAction = w->actionByName( QL1S("open_last_closed_tab") );
openLastClosedTabAction->setEnabled( mv->recentlyClosedTabs().size() > 0 );
// update closed tabs menu
KActionMenu *am = qobject_cast<KActionMenu *>( w->actionByName( QL1S("closed_tab_menu") ));
if (!am)
return;
bool isEnabled = ( mv->recentlyClosedTabs().size() > 0 );
am->setEnabled(isEnabled);
if (am->menu())
am->menu()->clear();
if(!isEnabled)
return;
Q_FOREACH(const HistoryItem &item, mv->recentlyClosedTabs())
{
KAction *a = new KAction(Application::iconManager()->iconForUrl(item.url), item.title, this);
a->setData(item.url);
connect(a, SIGNAL(triggered()), mv, SLOT(openClosedTab()));
am->addAction(a);
}
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:30,代码来源:tabbar.cpp
示例8: AdBlockRuleImpl
AdBlockRuleFallbackImpl::AdBlockRuleFallbackImpl(const QString &filter)
: AdBlockRuleImpl(filter)
{
m_regExp.setCaseSensitivity(Qt::CaseInsensitive);
m_regExp.setPatternSyntax(QRegExp::RegExp2);
QString parsedLine = filter;
const int optionsNumber = parsedLine.lastIndexOf(QL1C('$'));
if (optionsNumber >= 0 && !isRegExpFilter(parsedLine)) {
const QStringList options(parsedLine.mid(optionsNumber + 1).split(QL1C(',')));
parsedLine = parsedLine.left(optionsNumber);
if (options.contains(QL1S("match-case")))
m_regExp.setCaseSensitivity(Qt::CaseSensitive);
foreach (const QString &option, options) {
// Domain restricted filter
const QString domainKeyword(QL1S("domain="));
if (option.startsWith(domainKeyword)) {
QStringList domainList = option.mid(domainKeyword.length()).split(QL1C('|'));
foreach (const QString &domain, domainList) {
if (domain.startsWith(QL1C('~')))
m_whiteDomains.insert(domain.toLower());
else
m_blackDomains.insert(domain.toLower());
}
}
}
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:30,代码来源:adblockrulefallbackimpl.cpp
示例9: ServiceRoot
StandardServiceRoot::StandardServiceRoot(RootItem *parent)
: ServiceRoot(parent), m_recycleBin(new RecycleBin(this)),
m_actionExportFeeds(nullptr), m_actionImportFeeds(nullptr), m_serviceMenu(QList<QAction*>()),
m_feedContextMenu(QList<QAction*>()), m_actionFeedFetchMetadata(nullptr) {
setTitle(qApp->system()->getUsername() + QL1S("@") + QL1S(APP_LOW_NAME));
setIcon(StandardServiceEntryPoint().icon());
setDescription(tr("This is obligatory service account for standard RSS/RDF/ATOM feeds."));
}
开发者ID:pmattern,项目名称:rssguard,代码行数:9,代码来源:standardserviceroot.cpp
示例10: QL1S
QString QzTools::escapeSqlString(QString urlString)
{
const static QString &escapeString = QL1S("!");
urlString.replace(escapeString, escapeString + escapeString);
urlString.replace(QL1S("_"), escapeString + QL1S("_"));
urlString.replace(QL1S("%"), escapeString + QL1S("%"));
return urlString;
}
开发者ID:Kulteam,项目名称:qupzilla,代码行数:9,代码来源:qztools.cpp
示例11: isMultimediaElement
static bool isMultimediaElement(const QWebElement& element)
{
if (element.tagName().compare(QL1S("video"), Qt::CaseInsensitive) == 0)
return true;
if (element.tagName().compare(QL1S("audio"), Qt::CaseInsensitive) == 0)
return true;
return false;
}
开发者ID:KDE,项目名称:kwebkitpart,代码行数:10,代码来源:webview.cpp
示例12: AccessManager
NetworkAccessManager::NetworkAccessManager(QObject *parent)
: AccessManager(parent)
{
QString c = KGlobal::locale()->country();
if (c == QL1S("C"))
c = QL1S("en_US");
if (c != QL1S("en_US"))
c.append(QL1S(", en_US"));
_acceptLanguage = c.toLatin1();
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:11,代码来源:networkaccessmanager.cpp
示例13: QL1S
void ThumbUpdater::updateThumb()
{
// Set loading animation
_thumb.findFirst(QL1S(".preview img")).setAttribute(QL1S("src"), QL1S("file:///") + KStandardDirs::locate("appdata", "pics/busywidget.gif"));
_thumb.findFirst(QL1S("span a")).setPlainText(i18n("Loading Preview..."));
// Load URL
QWebFrame *frame = qobject_cast<QWebFrame *>(parent());
WebSnap *snap = new WebSnap(KUrl(_url), frame);
connect(snap, SIGNAL(snapDone(bool)), this, SLOT(updateImage(bool)), Qt::UniqueConnection);
}
开发者ID:KDE,项目名称:rekonq,代码行数:11,代码来源:thumbupdater.cpp
示例14: tr
void FormEditTtRssAccount::onUrlChanged() {
const QString url = m_ui->m_txtUrl->lineEdit()->text();
if (url.isEmpty()) {
m_ui->m_txtUrl->setStatus(WidgetWithStatus::Error, tr("URL cannot be empty."));
}
else if (url.endsWith(QL1S("/api/")) || url.endsWith(QL1S("/api"))) {
m_ui->m_txtUrl->setStatus(WidgetWithStatus::Warning, tr("URL should NOT end with \"/api/\"."));
}
else {
m_ui->m_txtUrl->setStatus(WidgetWithStatus::Ok, tr("URL is okay."));
}
}
开发者ID:martinrotter,项目名称:rssguard,代码行数:13,代码来源:formeditttrssaccount.cpp
示例15: setupHistoryActions
void TabBar::contextMenu(int tab, const QPoint &pos)
{
KActionMenu *closedTabsMenu = setupHistoryActions();
m_actualIndex = tab;
KMenu menu;
MainWindow *mainWindow = rApp->mainWindow();
menu.addAction(mainWindow->actionByName(QL1S("new_tab")));
menu.addAction(mainWindow->actionByName(QL1S("clone_tab")));
if (count() > 1)
{
menu.addAction(mainWindow->actionByName(QL1S("detach_tab")));
}
menu.addAction(mainWindow->actionByName(QL1S("open_last_closed_tab")));
menu.addAction(closedTabsMenu);
menu.addSeparator();
menu.addAction(mainWindow->actionByName(QL1S("close_tab")));
if (count() > 1)
{
menu.addAction(mainWindow->actionByName(QL1S("close_other_tabs")));
}
menu.addSeparator();
menu.addAction(mainWindow->actionByName(QL1S("reload_tab")));
if (count() > 1)
{
menu.addAction(mainWindow->actionByName(QL1S("reload_all_tabs")));
}
menu.exec(pos);
}
开发者ID:Arakmar,项目名称:rekonq,代码行数:31,代码来源:tabbar.cpp
示例16: excludedMimeType
static bool excludedMimeType(const QString &type)
{
if (type.startsWith(QL1S("inode/"), Qt::CaseInsensitive))
return true;
if (type.startsWith(QL1S("application/x-java"), Qt::CaseInsensitive))
return true;
if (type == QL1S("application/x-shockwave-flash") ||
type == QL1S("application/futuresplash"))
return true;
return false;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:14,代码来源:kwebpluginfactory.cpp
示例17: u
void ThumbUpdater::updateImage(bool ok)
{
KUrl u(_url);
QString previewPath = ok
? QL1S("file://") + WebSnap::imagePathFromUrl(u)
: IconManager::self()->iconPathForUrl(u)
;
_thumb.findFirst(QL1S(".preview img")).setAttribute(QL1S("src"), previewPath);
_thumb.findFirst(QL1S("span a")).setPlainText(_title);
this->deleteLater();
}
开发者ID:KDE,项目名称:rekonq,代码行数:14,代码来源:thumbupdater.cpp
示例18: testSplitQueries_data
void testSplitQueries_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<QStringList>("output");
QTest::newRow("empty") << QString() << QStringList();
QTest::newRow("comment1") << "-- hi there" << (QStringList() << QL1S("-- hi there"));
QTest::newRow("comment2") << "-- hi there\n" << (QStringList() << QL1S("-- hi there\n"));
QTest::newRow("comment3") << "-- hi there\n\n" << (QStringList() << QL1S("-- hi there\n\n"));
QTest::newRow("query1") << "SELECT * FROM tblVersion;" << (QStringList() << QL1S("SELECT * FROM tblVersion;"));
QTest::newRow("query2") << "SELECT * FROM tblVersion;\n" << (QStringList() << QL1S("SELECT * FROM tblVersion"));
QTest::newRow("query3") << "SELECT * FROM tblVersion\n" << (QStringList() << QL1S("SELECT * FROM tblVersion\n"));
QTest::newRow("multi1") << "SELECT a FROM b;\nSELECT c FROM d" << (QStringList() << QL1S("SELECT a FROM b") << QL1S("SELECT c FROM d"));
}
开发者ID:02JanDal,项目名称:sqlate,代码行数:14,代码来源:sqlutilstest.cpp
示例19: QL1S
QString Scripts::setCss(const QString &css)
{
QString source = QL1S("(function() {"
"var css = document.createElement('style');"
"css.setAttribute('type', 'text/css');"
"css.appendChild(document.createTextNode('%1'));"
"document.getElementsByTagName('head')[0].appendChild(css);"
"})()");
QString style = css;
style.replace(QL1S("'"), QL1S("\\'"));
style.replace(QL1S("\n"), QL1S("\\n"));
return source.arg(style);
}
开发者ID:Acidburn0zzz,项目名称:qupzilla,代码行数:14,代码来源:scripts.cpp
示例20: convertUrlToText
QString LocationBar::convertUrlToText(const QUrl &url)
{
// It was most probably entered by user, so don't urlencode it
if (url.scheme().isEmpty()) {
return QUrl::fromPercentEncoding(url.toEncoded());
}
QString stringUrl = QzTools::urlEncodeQueryString(url);
if (stringUrl == QL1S("qupzilla:speeddial") || stringUrl.startsWith(QL1S("qupzilla:adblock")) || stringUrl == QL1S("about:blank")) {
stringUrl.clear();
}
return stringUrl;
}
开发者ID:kkofler,项目名称:qupzilla,代码行数:15,代码来源:locationbar.cpp
注:本文中的QL1S函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论