Commit 93efade5 authored by Bartosz Brachaczek's avatar Bartosz Brachaczek

qt5: Use QCoreApplication where applicable

Signed-off-by: default avatarBartosz Brachaczek <b.brachaczek@gmail.com>
parent 92206948
......@@ -339,12 +339,12 @@ void ChatStylesManager::mainConfigurationWindowCreated(MainConfigurationWindow *
ConfigGroupBox *groupBox = window->widget()->configGroupBox("Look", "Chat", "Style");
//editor
QLabel *editorLabel = new QLabel(qApp->translate("@default", "Style") + ':');
editorLabel->setToolTip(qApp->translate("@default", "Choose style of chat window"));
QLabel *editorLabel = new QLabel(QCoreApplication::translate("@default", "Style") + ':');
editorLabel->setToolTip(QCoreApplication::translate("@default", "Choose style of chat window"));
QWidget *editor = new QWidget(groupBox->widget());
editor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
editor->setToolTip(qApp->translate("@default", "Choose style of chat window"));
editor->setToolTip(QCoreApplication::translate("@default", "Choose style of chat window"));
QHBoxLayout *editorLayout = new QHBoxLayout(editor);
SyntaxListCombo = new QComboBox(editor);
......@@ -375,8 +375,8 @@ void ChatStylesManager::mainConfigurationWindowCreated(MainConfigurationWindow *
connect(VariantListCombo, SIGNAL(activated(const QString &)), this, SLOT(variantChangedSlot(const QString &)));
//
groupBox->addWidgets(editorLabel, editor);
groupBox->addWidgets(new QLabel(qApp->translate("@default", "Style variant") + ':'), VariantListCombo);
groupBox->addWidgets(new QLabel(qApp->translate("@default", "Preview") + ':'), EnginePreview, Qt::AlignRight | Qt::AlignTop);
groupBox->addWidgets(new QLabel(QCoreApplication::translate("@default", "Style variant") + ':'), VariantListCombo);
groupBox->addWidgets(new QLabel(QCoreApplication::translate("@default", "Preview") + ':'), EnginePreview, Qt::AlignRight | Qt::AlignTop);
TurnOnTransparency = static_cast<QCheckBox *>(window->widget()->widgetById("useTransparency"));
TurnOnTransparency->setEnabled(CompositingEnabled);
......
......@@ -113,16 +113,16 @@ while (length > NUM) \
switch (q)
{
case 1:
str += qApp->translate("AdiumTimeFormatter", "1st quarter");
str += QCoreApplication::translate("AdiumTimeFormatter", "1st quarter");
break;
case 2:
str += qApp->translate("AdiumTimeFormatter", "2nd quarter");
str += QCoreApplication::translate("AdiumTimeFormatter", "2nd quarter");
break;
case 3:
str += qApp->translate("AdiumTimeFormatter", "3rd quarter");
str += QCoreApplication::translate("AdiumTimeFormatter", "3rd quarter");
break;
case 4:
str += qApp->translate("AdiumTimeFormatter", "4th quarter");
str += QCoreApplication::translate("AdiumTimeFormatter", "4th quarter");
break;
default:
break;
......
......@@ -76,12 +76,12 @@ Buddy DeleteTalkableAction::actionBuddy(ActionContext *context) const
void DeleteTalkableAction::setChatActionTitleAndIcon(Action *action)
{
action->setText(qApp->translate("KaduWindowActions", "Delete Chat"));
action->setText(QCoreApplication::translate("KaduWindowActions", "Delete Chat"));
}
void DeleteTalkableAction::setBuddyActionTitleAndIcon(Action *action)
{
action->setText(qApp->translate("KaduWindowActions", "Delete Buddy"));
action->setText(QCoreApplication::translate("KaduWindowActions", "Delete Buddy"));
}
void DeleteTalkableAction::updateChatActionState(Action *action)
......
......@@ -76,7 +76,7 @@ Buddy EditTalkableAction::actionBuddy(ActionContext *context) const
void EditTalkableAction::setChatActionTitleAndIcon(Action *action)
{
action->setIcon(KaduIcon("x-office-address-book"));
action->setText(qApp->translate("KaduWindowActions", "View Chat Properties"));
action->setText(QCoreApplication::translate("KaduWindowActions", "View Chat Properties"));
}
void EditTalkableAction::setBuddyActionTitleAndIcon(Action *action)
......@@ -85,12 +85,12 @@ void EditTalkableAction::setBuddyActionTitleAndIcon(Action *action)
if (buddy.isAnonymous() && 1 == action->context()->buddies().count())
{
action->setIcon(KaduIcon("contact-new"));
action->setText(qApp->translate("KaduWindowActions", "Add Buddy..."));
action->setText(QCoreApplication::translate("KaduWindowActions", "Add Buddy..."));
}
else
{
action->setIcon(KaduIcon("x-office-address-book"));
action->setText(qApp->translate("KaduWindowActions", "View Buddy Properties"));
action->setText(QCoreApplication::translate("KaduWindowActions", "View Buddy Properties"));
}
}
......
......@@ -52,7 +52,7 @@ void BuddyListBackgroundColorsWidget::createGui(MainConfigurationWindow* mainWin
ConfigGroupBox *groupBox = mainWindow->widget()->configGroupBox("Look", "Buddies list", "Background");
groupBox->addWidgets(new QLabel(qApp->translate("@default", "Background colors") + ':', this), this);
groupBox->addWidgets(new QLabel(QCoreApplication::translate("@default", "Background colors") + ':', this), this);
}
void BuddyListBackgroundColorsWidget::loadConfiguration()
......
......@@ -44,11 +44,11 @@ void ConfigActionButton::createWidgets()
{
kdebugf();
setText(qApp->translate("@default", widgetCaption.toUtf8().constData()));
setText(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()));
parentConfigGroupBox->addWidgets(new QLabel(" "), this);
if (!ConfigWidget::toolTip.isEmpty())
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
#include "moc_config-action-button.cpp"
......@@ -44,11 +44,11 @@ void ConfigCheckBox::createWidgets()
{
kdebugf();
setText(qApp->translate("@default", widgetCaption.toUtf8().constData()));
setText(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()));
parentConfigGroupBox->addWidget(this, true);
if (!ConfigWidget::toolTip.isEmpty())
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
void ConfigCheckBox::loadConfiguration()
......
......@@ -50,13 +50,13 @@ void ConfigColorButton::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -79,7 +79,7 @@ void ConfigComboBox::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
clear();
......@@ -87,8 +87,8 @@ void ConfigComboBox::createWidgets()
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......@@ -143,9 +143,9 @@ bool ConfigComboBox::fromDomElement(QDomElement domElement)
continue;
itemValues.append(element.attribute("value"));
itemCaptions.append(qApp->translate("@default", element.attribute("caption").toUtf8().constData()));
itemCaptions.append(QCoreApplication::translate("@default", element.attribute("caption").toUtf8().constData()));
addItem(qApp->translate("@default", element.attribute("caption").toUtf8().constData()));
addItem(QCoreApplication::translate("@default", element.attribute("caption").toUtf8().constData()));
}
}
......
......@@ -49,13 +49,13 @@ void ConfigHotKeyEdit::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -43,12 +43,12 @@ void ConfigLabel::createWidgets()
{
kdebugf();
setText(qApp->translate("@default", widgetCaption.toUtf8().constData()));
setText(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()));
setWordWrap(true);
parentConfigGroupBox->addWidget(this);
if (!ConfigWidget::toolTip.isEmpty())
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
void ConfigLabel::setText(const QString &text, bool defaultFormatting)
......
......@@ -51,13 +51,13 @@ void ConfigLineEdit::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -78,7 +78,7 @@ void ConfigListWidget::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this, Qt::AlignRight | Qt::AlignTop);
clear();
......@@ -86,8 +86,8 @@ void ConfigListWidget::createWidgets()
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......@@ -131,7 +131,7 @@ bool ConfigListWidget::fromDomElement(QDomElement domElement)
itemValues.append(element.attribute("value"));
itemCaptions.append(element.attribute("caption"));
addItem(qApp->translate("@default", element.attribute("caption").toUtf8().constData()));
addItem(QCoreApplication::translate("@default", element.attribute("caption").toUtf8().constData()));
}
}
......
......@@ -51,13 +51,13 @@ void ConfigPathListEdit::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -49,7 +49,7 @@ void ConfigPreview::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this, Qt::AlignRight | Qt::AlignTop);
}
......
......@@ -43,15 +43,15 @@ void ConfigProxyComboBox::createWidgets()
{
kdebugf();
Label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
Label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(Label, this);
clear();
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
Label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
Label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -44,11 +44,11 @@ void ConfigRadioButton::createWidgets()
{
kdebugf();
setText(qApp->translate("@default", widgetCaption.toUtf8().constData()));
setText(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()));
parentConfigGroupBox->addWidget(this, true);
if (!ConfigWidget::toolTip.isEmpty())
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
void ConfigRadioButton::loadConfiguration()
......
......@@ -51,13 +51,13 @@ void ConfigSelectFile::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -50,13 +50,13 @@ void ConfigSelectFont::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -54,13 +54,13 @@ void ConfigSlider::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -35,7 +35,7 @@ ConfigSpinBox::ConfigSpinBox(const QString &section, const QString &item, const
label(0)
{
if (!specialValue.isEmpty())
setSpecialValueText(qApp->translate("@default", specialValue.toUtf8().constData()));
setSpecialValueText(QCoreApplication::translate("@default", specialValue.toUtf8().constData()));
setMinimum(minValue);
setMaximum(maxValue);
setSingleStep(step);
......@@ -59,13 +59,13 @@ void ConfigSpinBox::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......@@ -99,7 +99,7 @@ bool ConfigSpinBox::fromDomElement(QDomElement domElement)
Suffix = domElement.attribute("suffix");
if (!specialValue.isEmpty())
setSpecialValueText(qApp->translate("@default", specialValue.toUtf8().constData()));
setSpecialValueText(QCoreApplication::translate("@default", specialValue.toUtf8().constData()));
bool ok;
......@@ -123,7 +123,7 @@ void ConfigSpinBox::onValueChanged(int i)
QString suffix = Suffix;
if (Suffix.contains("%n"))
{
suffix = qApp->translate("@default", Suffix.toUtf8().constData(), 0, QCoreApplication::CodecForTr, i);
suffix = QCoreApplication::translate("@default", Suffix.toUtf8().constData(), 0, QCoreApplication::CodecForTr, i);
QRegExp rx(QString("^.*%1").arg(i));
rx.setMinimal(true);
suffix.remove(rx);
......
......@@ -51,13 +51,13 @@ void ConfigSyntaxEditor::createWidgets()
{
kdebugf();
label = new QLabel(qApp->translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
label = new QLabel(QCoreApplication::translate("@default", widgetCaption.toUtf8().constData()) + ':', parentConfigGroupBox->widget());
parentConfigGroupBox->addWidgets(label, this);
if (!ConfigWidget::toolTip.isEmpty())
{
setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(qApp->translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
label->setToolTip(QCoreApplication::translate("@default", ConfigWidget::toolTip.toUtf8().constData()));
}
}
......
......@@ -213,7 +213,7 @@ QList<ConfigWidget *> ConfigurationWidget::processUiSectionFromDom(QDomNode sect
// Additional slash is needed so that QUrl would treat the rest as _path_, which is desired here.
if (iconPath.startsWith("datapath:///"))
iconPath = KaduPaths::instance()->dataPath() + iconPath.midRef(static_cast<int>(qstrlen("datapath:///")));
configSection(KaduIcon(iconPath), qApp->translate("@default", sectionName.toUtf8().constData()), true);
configSection(KaduIcon(iconPath), QCoreApplication::translate("@default", sectionName.toUtf8().constData()), true);
const QDomNodeList children = sectionElement.childNodes();
uint length = children.length();
......@@ -432,12 +432,12 @@ ConfigGroupBox * ConfigurationWidget::configGroupBox(const QString &section, con
if (!s)
return 0;
return s->configGroupBox(qApp->translate("@default", tab.toUtf8().constData()), qApp->translate("@default", groupBox.toUtf8().constData()), create);
return s->configGroupBox(QCoreApplication::translate("@default", tab.toUtf8().constData()), QCoreApplication::translate("@default", groupBox.toUtf8().constData()), create);
}
ConfigSection * ConfigurationWidget::configSection(const QString &name)
{
return ConfigSections.value(qApp->translate("@default", name.toUtf8().constData()));
return ConfigSections.value(QCoreApplication::translate("@default", name.toUtf8().constData()));
}
ConfigSection * ConfigurationWidget::configSection(const KaduIcon &icon, const QString &name, bool create)
......
......@@ -179,7 +179,7 @@ NotifyTreeWidgetItem::NotifyTreeWidgetItem(QTreeWidget *parent, const QString &e
setData(1, Qt::UserRole, QVariant(ActiveNotifiers));
setData(0, Qt::UserRole, QVariant(eventName));
setText(0, qApp->translate("@default", name));
setText(0, QCoreApplication::translate("@default", name));
}
NotifyTreeWidgetItem::NotifyTreeWidgetItem(NotifyTreeWidgetItem *parent, const QString &eventName, const char *name, QStringList &notifiers)
......@@ -189,7 +189,7 @@ NotifyTreeWidgetItem::NotifyTreeWidgetItem(NotifyTreeWidgetItem *parent, const Q
setData(1, Qt::UserRole, QVariant(ActiveNotifiers));
setData(0, Qt::UserRole, QVariant(eventName));
setText(0, qApp->translate("@default", name));
setText(0, QCoreApplication::translate("@default", name));
}
void NotifyTreeWidgetItem::notifierChecked(Notifier *notifier, bool checked)
......
......@@ -23,9 +23,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo>
#include <QtCore/QTimer>
#include <QtGui/QApplication>
#include <QtGui/QGridLayout>
#include <QtGui/QLabel>
#include <QtGui/QProgressBar>
......@@ -268,7 +268,7 @@ void FileTransferWidget::fileTransferUpdate()
StartButton->hide();
}
qApp->processEvents();
QCoreApplication::processEvents();
}
#include "moc_file-transfer-widget.cpp"
......@@ -26,7 +26,7 @@
* http://th30z.netsons.org/2008/08/qt4-mac-searchbox-wrapper/
*/
#include <QtGui/QApplication>
#include <QtCore/QCoreApplication>
#include <QtGui/QHBoxLayout>
#include <QtGui/QKeyEvent>
#include <QtGui/QLabel>
......@@ -264,7 +264,7 @@ bool FilterWidget::sendKeyEventToView(QKeyEvent *event)
case Qt::Key_Up:
case Qt::Key_PageDown:
case Qt::Key_PageUp:
qApp->sendEvent(View, event);
QCoreApplication::sendEvent(View, event);
return true;
}
......
......@@ -41,9 +41,9 @@ QString GroupFilterTabData::tabName() const
case GroupFilterRegular:
return Filter.group().showName() ? Filter.group().name() : QString();
case GroupFilterEverybody:
return qApp->translate("GroupFilterTabData", "Everybody");
return QCoreApplication::translate("GroupFilterTabData", "Everybody");
case GroupFilterUngroupped:
return qApp->translate("GroupFilterTabData", "Ungrouped");
return QCoreApplication::translate("GroupFilterTabData", "Ungrouped");
case GroupFilterInvalid:
default:
return QString();
......
......@@ -281,7 +281,7 @@ void KaduWebView::saveImage()
fd->setFileMode(QFileDialog::AnyFile);
fd->setAcceptMode(QFileDialog::AcceptSave);
fd->setDirectory(config_file.readEntry("Chat", "LastImagePath"));
fd->setNameFilter(QString("%1 (*%2)").arg(qApp->translate("ImageDialog", "Images"), fileExt));
fd->setNameFilter(QString("%1 (*%2)").arg(QCoreApplication::translate("ImageDialog", "Images"), fileExt));
fd->setLabelText(QFileDialog::FileName, imageFullPath.section('/', -1));
fd->setWindowTitle(tr("Save image"));
......
......@@ -222,8 +222,8 @@ MainConfigurationWindow::MainConfigurationWindow() :
connect(infoPanelSyntaxPreview, SIGNAL(needFixup(QString &)), Core::instance()->kaduWindow()->infoPanel(), SLOT(styleFixup(QString &)));
connect(widget()->widgetById("infoPanelSyntax"), SIGNAL(syntaxChanged(const QString &)), infoPanelSyntaxPreview, SLOT(syntaxChanged(const QString &)));
widget()->widgetById("parseStatus")->setToolTip(qApp->translate("@default", SyntaxText));
(static_cast<ConfigSyntaxEditor *>(widget()->widgetById("infoPanelSyntax")))->setSyntaxHint(qApp->translate("@default", SyntaxText));
widget()->widgetById("parseStatus")->setToolTip(QCoreApplication::translate("@default", SyntaxText));
(static_cast<ConfigSyntaxEditor *>(widget()->widgetById("infoPanelSyntax")))->setSyntaxHint(QCoreApplication::translate("@default", SyntaxText));
userboxTransparency = static_cast<QCheckBox *>(widget()->widgetById("userboxTransparency"));
userboxAlpha = static_cast<QSlider *>(widget()->widgetById("userboxAlpha"));
......@@ -335,7 +335,7 @@ void MainConfigurationWindow::setIconThemes()
foreach (const Theme &theme, IconsManager::instance()->themeManager()->themes())
{
values.append(theme.name());
captions.append(qApp->translate("@default", theme.name().toUtf8().constData()));
captions.append(QCoreApplication::translate("@default", theme.name().toUtf8().constData()));
}
iconThemes->setItems(values, captions);
......@@ -381,7 +381,7 @@ void MainConfigurationWindow::setToolTipClasses()
QStringList toolTipClasses = ToolTipClassManager::instance()->getToolTipClasses();
foreach(const QString &toolTipClass, toolTipClasses)
{
captions << qApp->translate("@default", toolTipClass.toUtf8().constData());
captions << QCoreApplication::translate("@default", toolTipClass.toUtf8().constData());
values << toolTipClass;
}
......@@ -395,9 +395,9 @@ void MainConfigurationWindow::showLookChatAdvanced()
lookChatAdvanced = new ConfigurationWindow("LookChatAdvanced", tr("Advanced chat's look configuration"), "General", instanceDataManager());
lookChatAdvanced.data()->widget()->appendUiFile(KaduPaths::instance()->dataPath() + QLatin1String("configuration/dialog-look-chat-advanced.ui"));
lookChatAdvanced.data()->widget()->widgetById("chatSyntax")->setToolTip(qApp->translate("@default", SyntaxText));
lookChatAdvanced.data()->widget()->widgetById("conferencePrefix")->setToolTip(qApp->translate("@default", SyntaxText));
lookChatAdvanced.data()->widget()->widgetById("conferenceSyntax")->setToolTip(qApp->translate("@default", SyntaxText));
lookChatAdvanced.data()->widget()->widgetById("chatSyntax")->setToolTip(QCoreApplication::translate("@default", SyntaxText));
lookChatAdvanced.data()->widget()->widgetById("conferencePrefix")->setToolTip(QCoreApplication::translate("@default", SyntaxText));
lookChatAdvanced.data()->widget()->widgetById("conferenceSyntax")->setToolTip(QCoreApplication::translate("@default", SyntaxText));
connect(ChatStylesManager::instance(), SIGNAL(previewSyntaxChanged(QString)), this, SLOT(chatPreviewSyntaxChanged(QString)));
if (ChatStylesManager::instance()->syntaxListCombo())
......
......@@ -157,7 +157,7 @@ bool OpenChatWith::eventFilter(QObject *obj, QEvent *e)
key == Qt::Key_Left ||
key == Qt::Key_Right)
{
qApp->sendEvent(BuddiesView, e);
QCoreApplication::sendEvent(BuddiesView, e);
return true;
}
}
......
......@@ -261,10 +261,10 @@ int main(int argc, char *argv[])
xml_config_file = new XmlConfigFile();
if (!xml_config_file->isUsable())
{
QString errorMessage = qApp->translate("@default", "We're sorry, but Kadu cannot be loaded. "
QString errorMessage = QCoreApplication::translate("@default", "We're sorry, but Kadu cannot be loaded. "
"Profile is inaccessible. Please check permissions in the '%1' directory.")
.arg(KaduPaths::instance()->profilePath().left(KaduPaths::instance()->profilePath().length() - 1));
QMessageBox::critical(0, qApp->translate("@default", "Profile Inaccessible"), errorMessage, QMessageBox::Abort);
QMessageBox::critical(0, QCoreApplication::translate("@default", "Profile Inaccessible"), errorMessage, QMessageBox::Abort);
qFatal("%s", qPrintable(errorMessage));
}
config_file_ptr = new ConfigFile(KaduPaths::instance()->profilePath() + QLatin1String("kadu.conf"));
......@@ -279,8 +279,8 @@ int main(int argc, char *argv[])
QTranslator qt_qm, kadu_qm;
qt_qm.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
kadu_qm.load("kadu_" + lang, KaduPaths::instance()->dataPath() + QLatin1String("translations"));
qApp->installTranslator(&qt_qm);
qApp->installTranslator(&kadu_qm);
QCoreApplication::installTranslator(&qt_qm);
QCoreApplication::installTranslator(&kadu_qm);
QtLocalPeer *peer = new QtLocalPeer(qApp, KaduPaths::instance()->profilePath());
if (peer->isClient())
......
......@@ -126,7 +126,7 @@ static void kadu_signal_handler(int signal)
_activateWindow(Core::instance()->kaduWindow());
}
else if (signal == SIGINT || signal == SIGTERM)
qApp->quit();
QCoreApplication::quit();
}
void enableSignalHandling()
......
......@@ -53,34 +53,34 @@ QString printDateTime(const QDateTime &datetime)
if (ChatConfigurationHolder::instance()->niceDateFormat())
{
if (delta == 1) // 1 day ago
ret.prepend(qApp->translate("@default", "Yesterday at "));
ret.prepend(QCoreApplication::translate("@default", "Yesterday at "));
else if (delta < 7) // less than week ago
{
ret.prepend(datetime.toString(qApp->translate("@default", "dddd at ")));
ret.prepend(datetime.toString(QCoreApplication::translate("@default", "dddd at ")));
ret[0] = ret.at(0).toUpper(); // looks ugly lowercase ;)
}
else if ((delta > 7) && (delta < 14))
{
int tmp = delta % 7;
if (tmp == 0)
ret.prepend(qApp->translate("@default", "week ago at "));