Commit 2a18576a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Port most away most of KGlobal

We can't for tests, because we still use KStandardDirs
parent 243c781f
......@@ -27,7 +27,6 @@
#include <KDebug> // remove later
#include <KNotification>
#include <KLocalizedString>
#include <KGlobal>
#include <KParts/MainWindow>
#include "idebugsession.h"
......
......@@ -27,7 +27,6 @@
Boston, MA 02110-1301, USA.
*/
#include "iplugin.h"
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kcomponentdata.h>
#include <kiconloader.h>
......
......@@ -33,7 +33,6 @@
#include <QPointer>
#include <kdebug.h>
#include <kglobal.h>
#include <kconfiggroup.h>
#include <ksharedconfig.h>
#include <KLocalizedString>
......
......@@ -31,6 +31,7 @@
#include <kdebug.h>
#include <KLocalizedString>
#include <KFormat>
#include <ktexteditor/movinginterface.h>
#include "backgroundparser.h"
......@@ -274,13 +275,15 @@ KDevelop::ProblemPointer ParseJob::readContents()
static const int maximumFileSize = 5 * 1024 * 1024; // 5 MB
if (fileInfo.size() > maximumFileSize) {
KFormat f;
KDevelop::ProblemPointer p(new Problem());
p->setSource(KDevelop::ProblemData::Disk);
p->setDescription(i18nc("%1: filename", "Skipped file that is too large: '%1'", localFile ));
p->setExplanation(i18nc("%1: file size, %2: limit file size",
"The file is %1 and exceeds the limit of %2.",
KGlobal::locale()->formatByteSize(fileInfo.size()),
KGlobal::locale()->formatByteSize(maximumFileSize)));
f.formatByteSize(fileInfo.size()),
f.formatByteSize(maximumFileSize)));
p->setFinalLocation(DocumentRange(document(), KTextEditor::Range::invalid()));
kWarning( 9007 ) << p->description() << p->explanation();
return p;
......
......@@ -21,6 +21,7 @@
#include <util/pushvalue.h>
#include "codecompletionitem.h"
#include <language/duchain/ducontext.h>
#include <kdebug.h>
using namespace KDevelop;
......
......@@ -27,6 +27,7 @@
#include <ktexteditor/range.h>
#include <ktexteditor/view.h>
#include <ktexteditor/document.h>
#include <kdebug.h>
#include "../duchain/declaration.h"
#include "../duchain/duchainutils.h"
......
......@@ -22,8 +22,7 @@
#include <QtCore/QMutex>
#include <QtCore/QVector>
#include <QtCore/QStack>
#include <kglobal.h>
#include <kdebug.h>
#include <QString>
#include <util/kdevvarlengtharray.h>
#include <iostream>
#include <time.h>
......@@ -210,7 +209,7 @@ class TemporaryDataManager {
#define DEFINE_LIST_MEMBER_HASH(container, member, type) \
typedef KDevelop::TemporaryDataManager<KDevVarLengthArray<type, 10> > temporaryHash ## container ## member ## Type; \
K_GLOBAL_STATIC_WITH_ARGS(temporaryHash ## container ## member ## Type, temporaryHash ## container ## member ## Static, ( #container "::" #member )) \
Q_GLOBAL_STATIC_WITH_ARGS(temporaryHash ## container ## member ## Type, temporaryHash ## container ## member ## Static, ( #container "::" #member )) \
temporaryHash ## container ## member ## Type& temporaryHash ## container ## member() { \
return *temporaryHash ## container ## member ## Static; \
}
......
......@@ -33,8 +33,6 @@
#include <QtCore/QWaitCondition>
#include <QtCore/QMutex>
#include <KGlobal>
#include <interfaces/idocumentcontroller.h>
#include <interfaces/icore.h>
#include <interfaces/ilanguage.h>
......@@ -1099,7 +1097,7 @@ private:
ItemRepository<EnvironmentInformationItem, EnvironmentInformationRequest> m_environmentInfo;
};
K_GLOBAL_STATIC(DUChainPrivate, sdDUChainPrivate)
Q_GLOBAL_STATIC(DUChainPrivate, sdDUChainPrivate)
DUChain::DUChain()
......
......@@ -26,8 +26,9 @@
#include <qtextdocument.h>
#include <qboxlayout.h>
#include <interfaces/iassistant.h>
#include <qmenu.h>
#include <QMenu>
#include <kaction.h>
#include <kdebug.h>
#include <util/richtextpushbutton.h>
using namespace KDevelop;
......
......@@ -24,6 +24,8 @@
#include "typesystemdata.h"
#include "typeregister.h"
#include <QDebug>
namespace KDevelop {
REGISTER_TYPE(ConstantIntegralType);
......@@ -150,7 +152,7 @@ template<>
KDEVPLATFORMLANGUAGE_EXPORT
void ConstantIntegralType::setValueInternal<qint64>(qint64 value) {
if((modifiers() & UnsignedModifier)) {
kDebug() << "setValue(signed) called on unsigned type";
qWarning() << "setValue(signed) called on unsigned type";
}
d_func_dynamic()->m_value = value;
}
......@@ -159,7 +161,7 @@ template<>
KDEVPLATFORMLANGUAGE_EXPORT
void ConstantIntegralType::setValueInternal<quint64>(quint64 value) {
if(!(modifiers() & UnsignedModifier)) {
kDebug() << "setValue(unsigned) called on not unsigned type";
qWarning() << "setValue(unsigned) called on not unsigned type";
}
d_func_dynamic()->m_value = (qint64)value;
}
......@@ -168,7 +170,7 @@ template<>
KDEVPLATFORMLANGUAGE_EXPORT
void ConstantIntegralType::setValueInternal<float>(float value) {
if(dataType() != TypeFloat) {
kDebug() << "setValue(float) called on non-float type";
qWarning() << "setValue(float) called on non-float type";
}
memcpy(&d_func_dynamic()->m_value, &value, sizeof(float));
}
......@@ -177,7 +179,7 @@ template<>
KDEVPLATFORMLANGUAGE_EXPORT
void ConstantIntegralType::setValueInternal<double>(double value) {
if(dataType() != TypeDouble) {
kDebug() << "setValue(double) called on non-double type";
qWarning() << "setValue(double) called on non-double type";
}
memcpy(&d_func_dynamic()->m_value, &value, sizeof(double));
}
......
......@@ -24,7 +24,6 @@ Boston, MA 02110-1301, USA.
#include <util/processlinemaker.h>
#include <KDebug>
#include <KProcess>
#include <KGlobal>
#include <KLocalizedString>
#include <KShell>
#include <QFileInfo>
......
......@@ -25,6 +25,8 @@
#include <KUrl>
#include <KAction>
#include <KAboutData>
#include <KLocalizedString>
#include <KDebug>
#include <interfaces/iproject.h>
#include <project/projectmodel.h>
......
......@@ -45,6 +45,7 @@
#include <KPluginFactory>
#include <KAboutData>
#include <KProcess>
#include <KLocalizedString>
#include <QAction>
#include <QStandardItemModel>
......
......@@ -24,7 +24,6 @@
#include <kconfiggroup.h>
#include <kfiledialog.h>
#include <kpushbutton.h>
#include <kglobal.h>
#include <kiconloader.h>
#include <KLocalizedString>
#include <kconfig.h>
......
......@@ -26,8 +26,6 @@
#include <QFutureWatcher>
#include <kglobal.h>
#include <interfaces/iprojectfilemanager.h>
#include <interfaces/iproject.h>
#include <interfaces/icore.h>
......
......@@ -21,9 +21,8 @@
#define KDEVPLATFORM_COMPLETIONSETTINGS_H
#include <interfaces/icompletionsettings.h>
#include <kconfiggroup.h>
#include <ksharedconfig.h>
#include <kglobal.h>
#include <KConfigGroup>
#include <KSharedConfig>
namespace KDevelop
{
......
......@@ -24,10 +24,8 @@
#include <QtCore/QTimer>
#include <kdebug.h>
#include <kglobal.h>
#include <KLocalizedString>
#include <KComponentData>
#include <ksplashscreen.h>
#include <language/duchain/duchain.h>
......
......@@ -26,7 +26,6 @@
#include <QPainter>
#include <KLocalizedString>
#include <kglobal.h>
#include <ktitlewidget.h>
#include <kcomponentdata.h>
#include <kaboutdata.h>
......
......@@ -19,12 +19,12 @@
#include <kurlcompletion.h>
#include <kurlcombobox.h>
#include <kurlpixmapprovider.h>
#include <kglobal.h>
#include <kfileitem.h>
#include <ksharedconfig.h>
#include <kdebug.h>
#include <kplugininfo.h>
#include <kfilewidget.h>
#include <KLocalizedString>
#include "shellextension.h"
#include "core.h"
......
......@@ -25,7 +25,6 @@
#include <KDebug>
#include <KLocalizedString>
#include <KGlobal>
namespace KDevelop {
......@@ -146,7 +145,7 @@ struct ProgressManagerPrivate {
ProgressManager instance;
};
K_GLOBAL_STATIC( ProgressManagerPrivate, progressManagerPrivate )
Q_GLOBAL_STATIC( ProgressManagerPrivate, progressManagerPrivate )
ProgressManager::ProgressManager()
: QObject()
......
......@@ -25,7 +25,6 @@ Boston, MA 02110-1301, USA.
#include <QtCore/QStringList>
#include <QtCore/QTimer>
#include <kglobal.h>
#include <kcmdlineargs.h>
#include <kconfiggroup.h>
#include <kstandarddirs.h>
......@@ -297,7 +296,7 @@ public:
static QString sessionBaseDirectory()
{
return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +'/'+ KGlobal::mainComponent().componentName() + "/sessions/";
return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +'/'+ KComponentData::mainComponent().componentName() + "/sessions/";
}
QString ownSessionDirectory() const
......
......@@ -27,9 +27,9 @@
#include <kcomponentdata.h>
#include <kprocess.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <kglobal.h>
#include <tests/autotestshell.h>
#include <tests/testcore.h>
......
......@@ -22,10 +22,10 @@
#include <tests/autotestshell.h>
#include <tests/testcore.h>
#include <kglobal.h>
#include <kdebug.h>
#include <kio/netaccess.h>
#include <kconfiggroup.h>
#include <KLocalizedString>
#include "../core.h"
#include "../sessioncontroller.h"
......
......@@ -35,6 +35,7 @@
#include <kstandarddirs.h>
#include <kxmlguifactory.h>
#include <kdeversion.h>
#include <kdebug.h>
#include <KComponentData>
#include <ktexteditor/view.h>
......@@ -766,7 +767,7 @@ KTextEditor::View *KDevelop::TextView::textView() const
QString KDevelop::TextView::viewStatus() const
{
const KTextEditor::Cursor pos = d->view ? d->view->cursorPosition() : KTextEditor::Cursor::invalid();
return i18n(" Line: %1 Col: %2 ", KGlobal::locale()->formatNumber(pos.line() + 1, 0), KGlobal::locale()->formatNumber(pos.column() + 1, 0));
return i18n(" Line: %1 Col: %2 ", pos.line() + 1, pos.column() + 1);
}
void KDevelop::TextViewPrivate::sendStatusChanged()
......
......@@ -25,7 +25,6 @@
#include <QApplication>
#include <kdebug.h>
#include <KGlobal>
#include <KSharedConfig>
#include "area.h"
......
......@@ -25,7 +25,6 @@
#include "kdebug.h"
#include <KConfigGroup>
#include <KGlobal>
#include <KConfig>
using namespace Sublime;
......
......@@ -20,7 +20,6 @@
#include "testproject.h"
#include <KGlobal>
#include <QDebug>
#include <project/projectmodel.h>
......
......@@ -24,7 +24,6 @@ Boston, MA 02110-1301, USA.
#include <QStringListModel>
#include <KGlobal>
#include <KLocalizedString>
namespace KDevelop
......
......@@ -20,7 +20,6 @@ Boston, MA 02110-1301, USA.
#include "environmentgrouplist.h"
#include "environmentselectionmodel.h"
#include <ksettings/dispatcher.h>
#include <kglobal.h>
#include <interfaces/icore.h>
#include <kcomponentdata.h>
#include <QBoxLayout>
......
......@@ -29,10 +29,10 @@
#include <QBrush>
#include <QPen>
#include <QHash>
#include <QLocale>
#include <kurl.h>
#include <KLocalizedString>
#include <kglobal.h>
#include <kdebug.h>
#include <interfaces/icore.h>
......@@ -126,7 +126,7 @@ QVariant VcsAnnotationModel::data( int line, Qt::ItemDataRole role ) const
} else if( role == Qt::ToolTipRole )
{
return QVariant( i18n("Author: %1\nDate: %2\nCommit Message: %3",
aline.author(), KGlobal::locale()->formatDateTime( aline.date() ), aline.commitMessage() ) );
aline.author(), QLocale().toString( aline.date() ), aline.commitMessage() ) );
}
return QVariant();
}
......
......@@ -24,8 +24,8 @@
#include <QVariant>
#include <QDateTime>
#include <QList>
#include <QLocale>
#include <kglobal.h>
#include <KLocalizedString>
#include "../vcsevent.h"
......@@ -93,7 +93,7 @@ QVariant VcsEventModel::data( const QModelIndex& idx, int role ) const
case AuthorColumn:
return QVariant( ev.author() );
case DateColumn:
return QVariant( KGlobal::locale()->formatDateTime( ev.date() ) );
return QVariant( QLocale().toString( ev.date() ) );
default:
break;
}
......
......@@ -17,7 +17,6 @@
#include <kaboutdata.h>
#include <KLocalizedString>
#include <kglobal.h>
#include <kconfig.h>
#include <kmessagebox.h>
#include <kconfiggroup.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment