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


C++ KApplication::disableAutoDcopRegistration方法代码示例

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


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

示例1: main

int main(int argc, char **argv)
{
    // Ensure that user configuration doesn't change the results of those tests
    // KDEHOME needs to be writable though, for a ksycoca database
    setenv("KDEHOME", QFile::encodeName(QDir::homeDirPath() + "/.kde-kurifiltertest"), true);
    setenv("KDE_FORK_SLAVES", "yes", true); // simpler, for the final cleanup

    KAboutData aboutData(appName, programName, version, description);
    KCmdLineArgs::init(argc, argv, &aboutData);
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    app.disableAutoDcopRegistration();

    // Allow testing of the search engine using both delimiters...
    char delimiter = KCmdLineArgs::parsedArgs()->isSet("s") ? ' ' : ':';

    // Many tests check the "default search engine" feature.
    // There is no default search engine by default (since it was annoying when making typos),
    // so the user has to set it up, which we do here.
    {
        KSimpleConfig cfg("kuriikwsfilterrc");
        cfg.setGroup("General");
        cfg.writeEntry("DefaultSearchEngine", "google");
        cfg.writeEntry("Verbose", true);
        cfg.writeEntry("KeywordDelimiter", delimiter);
        cfg.sync();
    }

    // Enable verbosity for debugging
    {
        KSimpleConfig cfg("kshorturifilterrc");
        cfg.writeEntry("Verbose", true);
        cfg.sync();
    }

    QStringList minicliFilters;
    minicliFilters << "kshorturifilter"
                   << "kurisearchfilter"
                   << "localdomainurifilter";

    // URI that should require no filtering
    filter("http://www.kde.org", "http://www.kde.org", KURIFilterData::NET_PROTOCOL);
    filter("http://www.kde.org/developer//index.html", "http://www.kde.org/developer//index.html", KURIFilterData::NET_PROTOCOL);
    // URL with reference
    filter("http://www.kde.org/index.html#q8", "http://www.kde.org/index.html#q8", KURIFilterData::NET_PROTOCOL);
    // local file with reference
    filter("file:/etc/passwd#q8", "file:///etc/passwd#q8", KURIFilterData::LOCAL_FILE);
    filter("file:///etc/passwd#q8", "file:///etc/passwd#q8", KURIFilterData::LOCAL_FILE);
    filter("/etc/passwd#q8", "file:///etc/passwd#q8", KURIFilterData::LOCAL_FILE);
    // local file with query (can be used by javascript)
    filter("file:/etc/passwd?foo=bar", "file:///etc/passwd?foo=bar", KURIFilterData::LOCAL_FILE);
    testLocalFile("/tmp/kurifiltertest?foo");     // local file with ? in the name (#58990)
    testLocalFile("/tmp/kurlfiltertest#foo");     // local file with '#' in the name
    testLocalFile("/tmp/kurlfiltertest#foo?bar"); // local file with both
    testLocalFile("/tmp/kurlfiltertest?foo#bar"); // local file with both, the other way round

    // hostnames are lowercased by KURL
    filter("http://www.myDomain.commyPort/ViewObjectRes//Default:name=hello", "http://www.mydomain.commyport/ViewObjectRes//Default:name=hello",
           KURIFilterData::NET_PROTOCOL);
    filter("ftp://ftp.kde.org", "ftp://ftp.kde.org", KURIFilterData::NET_PROTOCOL);
    filter("ftp://[email protected]:500", "ftp://[email protected]:500", KURIFilterData::NET_PROTOCOL);

    // ShortURI/LocalDomain filter tests. NOTE: any of these tests can fail
    // if you have specified your own patterns in kshorturifilterrc. For
    // examples, see $KDEDIR/share/config/kshorturifilterrc .
    filter("linuxtoday.com", "http://linuxtoday.com", KURIFilterData::NET_PROTOCOL);
    filter("LINUXTODAY.COM", "http://linuxtoday.com", KURIFilterData::NET_PROTOCOL);
    filter("kde.org", "http://kde.org", KURIFilterData::NET_PROTOCOL);
    filter("ftp.kde.org", "ftp://ftp.kde.org", KURIFilterData::NET_PROTOCOL);
    filter("ftp.kde.org:21", "ftp://ftp.kde.org:21", KURIFilterData::NET_PROTOCOL);
    filter("cr.yp.to", "http://cr.yp.to", KURIFilterData::NET_PROTOCOL);
    filter("[email protected]:3128", "http://[email protected]:3128", KURIFilterData::NET_PROTOCOL);
    filter("127.0.0.1", "http://127.0.0.1", KURIFilterData::NET_PROTOCOL);
    filter("127.0.0.1:3128", "http://127.0.0.1:3128", KURIFilterData::NET_PROTOCOL);
    filter("[email protected]", "mailto:[email protected]", KURIFilterData::NET_PROTOCOL);
    filter("[email protected]", "mailto:[email protected]", KURIFilterData::NET_PROTOCOL);
    filter("www.123.foo", "http://www.123.foo", KURIFilterData::NET_PROTOCOL);
    filter("[email protected]:3128", "http://[email protected]:3128", KURIFilterData::NET_PROTOCOL);

    // Exotic IPv4 address formats...
    filter("127.1", "http://127.1", KURIFilterData::NET_PROTOCOL);
    filter("127.0.1", "http://127.0.1", KURIFilterData::NET_PROTOCOL);

    // Local domain filter - If you uncomment these test, make sure you
    // you adjust it based on the localhost entry in your /etc/hosts file.
    // filter( "localhost:3128", "http://localhost.localdomain:3128", KURIFilterData::NET_PROTOCOL );
    // filter( "localhost", "http://localhost.localdomain", KURIFilterData::NET_PROTOCOL );
    // filter( "localhost/~blah", "http://localhost.localdomain/~blah", KURIFilterData::NET_PROTOCOL );

    filter("/", "/", KURIFilterData::LOCAL_DIR);
    filter("/", "/", KURIFilterData::LOCAL_DIR, "kshorturifilter");
    filter("~/.bashrc", QDir::homeDirPath().local8Bit() + "/.bashrc", KURIFilterData::LOCAL_FILE, "kshorturifilter");
    filter("~", QDir::homeDirPath().local8Bit(), KURIFilterData::LOCAL_DIR, "kshorturifilter", "/tmp");
    filter("~foobar", 0, KURIFilterData::ERROR, "kshorturifilter");
    filter("[email protected]", "mailto:[email protected]", KURIFilterData::NET_PROTOCOL); // new in KDE-3.2

    // Windows style SMB (UNC) URL. Should be converted into the valid smb format...
    filter("\\\\mainserver\\share\\file", "smb://mainserver/share/file", KURIFilterData::NET_PROTOCOL);

//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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