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


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

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


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

示例1: main

int main(int argc, char **argv)
{
    KAboutData about("kftpgrabber", 0, ki18n("KFTPgrabber"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2008, The KFTPgrabber developers"), KLocalizedString(), "http://www.kftp.org");
    about.addAuthor(ki18n("Jernej Kos"), ki18n("Lead developer"), "[email protected]");
    about.addAuthor(ki18n("Markus Brüffer"), ki18n("Developer"), "[email protected]");
    
    about.addCredit(ki18n("Lee Joseph"), ki18n("Fedora ambassador responsible for promotion, testing and debugging; also a package maintainer for Fedora-compatible distributions"), "[email protected]");
    about.addCredit(ki18n("libssh2 Developers"), ki18n("SSH library"), "[email protected]");
    about.addCredit(ki18n("Anthony D. Urso"), ki18n("otpCalc code"));
    about.addCredit(ki18n("Kopete Developers"), ki18n("KopeteBalloon popup code"), "[email protected]");
    about.addCredit(ki18n("KSysGuard Developers"), ki18n("Traffic graph widget"), "[email protected]");
    about.addCredit(ki18n("Bob Ziuchkovski"), ki18n("Icon design"), "[email protected]");
    about.addCredit(ki18n("Tobias Ussing"), ki18n("Testing and debugging"), "[email protected]");
    about.addCredit(ki18n("Tim Kosse"), ki18n("Directory parser code"), "[email protected]");
    about.addCredit(ki18n("Peter Penz"), ki18n("Listview column handling code"), "[email protected]");

    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("+[url]", ki18n("An optional URL to connect to"));
    KCmdLineArgs::addCmdLineOptions(options);
    KUniqueApplication app;
    
    if (app.isSessionRestored()) {
      RESTORE(MainWindow);
    } else {
      MainWindow *mainWindow = 0;
      KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

      KSplashScreen *splash = 0L;
      QString splashPath = KStandardDirs::locate("appdata", "kftpgrabber-logo.png");
      if (!KFTPCore::Config::startMinimized() && KFTPCore::Config::showSplash()) {
        // Show the splash screen
        if (!splashPath.isNull()) {
          QPixmap splashImage = QPixmap(splashPath);
          splash = new KSplashScreen(splashImage);
          splash->setMaximumWidth(400);
          splash->show();
        }
      }
      
      mainWindow = new MainWindow();
      if (!KFTPCore::Config::startMinimized())
        mainWindow->show();
        
      // Check if an URL was passed as a command line argument
      if (args->count() == 1) {
        KUrl remoteUrl = args->url(0);
        
        if (!remoteUrl.isLocalFile()) {
          if (!remoteUrl.port())
            remoteUrl.setPort(21);
            
          if (!remoteUrl.hasUser())
            remoteUrl.setUser("anonymous");
            
          if (!remoteUrl.hasPass()) {
            if (!KFTPCore::Config::anonMail().isEmpty())
              remoteUrl.setPass(KFTPCore::Config::anonMail());
            else
              remoteUrl.setPass("[email protected]");
          }

          KFTPSession::Manager::self()->spawnRemoteSession(KFTPSession::IgnoreSide, remoteUrl);
        }
      }
        
      if (splash != 0L) {
        splash->finish(mainWindow);
        delete splash;
      }
      
      args->clear();
    }
    
    return app.exec();
}
开发者ID:netrunner-debian-kde-extras,项目名称:kftpgrabber,代码行数:78,代码来源:main.cpp


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