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


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

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


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

示例1: init

void KApplicationPrivate::init()
{
  if ((getuid() != geteuid()) ||
      (getgid() != getegid()))
  {
     fprintf(stderr, "The KDE libraries are not designed to run with suid privileges.\n");
     ::exit(127);
  }


  KApplication::KApp = q;

  // make sure the clipboard is created before setting the window icon (bug 209263)
  (void) QApplication::clipboard();

  parseCommandLine();

  (void) KClipboardSynchronizer::self();

  QApplication::setDesktopSettingsAware( false );

#ifdef Q_WS_X11
  // create all required atoms in _one_ roundtrip to the X server
  const int max = 20;
  Atom* atoms[max];
  char* names[max];
  Atom atoms_return[max];
  int n = 0;

  atoms[n] = &atom_DesktopWindow;
  names[n++] = (char *) "KDE_DESKTOP_WINDOW";

  atoms[n] = &atom_NetSupported;
  names[n++] = (char *) "_NET_SUPPORTED";

  atoms[n] = &kde_xdnd_drop;
  names[n++] = (char *) "XdndDrop";

  XInternAtoms( QX11Info::display(), names, n, false, atoms_return );

  for (int i = 0; i < n; i++ )
    *atoms[i] = atoms_return[i];
#endif


  // sanity checking, to make sure we've connected
  QDBusConnectionInterface *bus = 0;
  if (!QDBusConnection::sessionBus().isConnected() || !(bus = QDBusConnection::sessionBus().interface())) {
      kFatal(240) << "Session bus not found" << endl <<
                  "To circumvent this problem try the following command (with Linux and bash)" << endl <<
                  "export $(dbus-launch)";
      ::exit(125);
  }

  extern bool s_kuniqueapplication_startCalled;
  if ( bus && !s_kuniqueapplication_startCalled ) // don't register again if KUniqueApplication did so already
  {
      QStringList parts = q->organizationDomain().split(QLatin1Char('.'), QString::SkipEmptyParts);
      QString reversedDomain;
      if (parts.isEmpty())
          reversedDomain = QLatin1String("local.");
      else
          foreach (const QString& s, parts)
          {
              reversedDomain.prepend(QLatin1Char('.'));
              reversedDomain.prepend(s);
          }
开发者ID:fluxer,项目名称:kdelibs,代码行数:67,代码来源:kapplication.cpp


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