getting rid of qAppName()

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2016-10-19 03:27:05 +00:00
parent 7c356db817
commit 9a809739dd
5 changed files with 4 additions and 14 deletions

View file

@ -335,13 +335,6 @@ void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
#endif
}
QString qAppName()
{
if (!QCoreApplicationPrivate::checkInstance("qAppName"))
return QString();
return QCoreApplication::instance()->d_func()->appName();
}
/*!
\class QCoreApplication
\brief The QCoreApplication class provides an event loop for console Qt

View file

@ -155,7 +155,6 @@ protected:
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *);
protected:
QCoreApplication(QCoreApplicationPrivate &p);
private:
@ -165,7 +164,7 @@ private:
void init();
static QCoreApplication *self;
Q_DISABLE_COPY(QCoreApplication)
friend class QEventDispatcherUNIXPrivate;
@ -176,7 +175,6 @@ private:
friend class QWidget;
friend class QWidgetPrivate;
friend bool qt_sendSpontaneousEvent(QObject*, QEvent*);
friend Q_CORE_EXPORT QString qAppName();
};
inline bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event)
@ -216,7 +214,6 @@ typedef void (*QtCleanUpFunction)();
Q_CORE_EXPORT void qAddPostRoutine(QtCleanUpFunction);
Q_CORE_EXPORT void qRemovePostRoutine(QtCleanUpFunction);
Q_CORE_EXPORT QString qAppName(); // get application name
QT_END_NAMESPACE

View file

@ -236,7 +236,7 @@ if (!qApp){ \
new QApplication(argc,argv); \
} \
QString s = QApplication::tr("Executable '%1' requires Qt "\
"%2, found Qt %3.").arg(qAppName()).arg(QString::fromLatin1(\
"%2, found Qt %3.").arg(QApplication::applicationName()).arg(QString::fromLatin1(\
str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplication::tr(\
"Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal("%s", s.toLatin1().data()); }}

View file

@ -5605,7 +5605,7 @@ static void sm_performSaveYourself(QSessionManagerPrivate* smd)
restart << argument0 << QLatin1String("-session")
<< smd->sessionId + QLatin1Char('_') + smd->sessionKey;
if (qstricmp(appName, QX11Info::appClass()) != 0)
restart << QLatin1String("-name") << qAppName();
restart << QLatin1String("-name") << QApplication::applicationName();
sm->setRestartCommand(restart);
QStringList discard;
sm->setDiscardCommand(discard);

View file

@ -778,7 +778,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
wm_hints.window_group = X11->wm_client_leader;
XClassHint class_hint;
QByteArray appName = qAppName().toLatin1();
QByteArray appName = QApplication::applicationName().toLatin1();
class_hint.res_name = appName.data(); // application name
class_hint.res_class = const_cast<char *>(QX11Info::appClass()); // application class