Commit 12c2427f authored by Halla Rempt's avatar Halla Rempt

Remove all checks for various KDE 4 versions

parent d0991e3c
......@@ -36,7 +36,6 @@
//
#include "widgets/kis_url_requester.h"
#include <kdeversion.h>
#include <kcolorbutton.h>
#include <klocalizedstring.h>
#include <kseparator.h>
......@@ -281,9 +280,7 @@ void KisGmicSettingsWidget::createSettingsWidget(ROLE role)
if (role == CreateRole)
{
colorButton = new KColorButton;
#if KDE_IS_VERSION(4,5,0)
colorButton->setAlphaChannelEnabled(colorParam->m_hasAlpha);
#endif
m_widgetToParameterIndexMapper[colorButton] = i;
mapParameterWidget(colorParam, colorButton);
......
......@@ -24,7 +24,6 @@
#include "KoGlobal.h"
#include <kcrash.h>
#include <kdeversion.h>
#include <klocale.h>
#include <kcmdlineargs.h>
#include <kdesktopfile.h>
......@@ -36,10 +35,7 @@
#include <kconfig.h>
#include <kglobal.h>
#include <kconfiggroup.h>
#if KDE_IS_VERSION(4,6,0)
#include <krecentdirs.h>
#endif
#include <QFile>
#include <QWidget>
......
......@@ -29,7 +29,6 @@
#include "KoConfig.h"
#include <kcrash.h>
#include <kdeversion.h>
#include <klocale.h>
#include <kcmdlineargs.h>
#include <kdesktopfile.h>
......@@ -41,10 +40,7 @@
#include <kconfig.h>
#include <kglobal.h>
#include <kconfiggroup.h>
#if KDE_IS_VERSION(4,6,0)
#include <krecentdirs.h>
#endif
#include <QFile>
#include <QWidget>
......
......@@ -45,10 +45,7 @@
#include <QTabBar>
#include <QMoveEvent>
#include <kdeversion.h>
#if KDE_IS_VERSION(4,6,0)
#include <krecentdirs.h>
#endif
#include <kaboutdata.h>
#include <kactioncollection.h>
#include <kaction.h>
......@@ -624,9 +621,7 @@ void KisMainWindow::addRecentURL(const KUrl& url)
ok = false; // it's in the tmp resource
if (ok) {
KRecentDocument::add(path);
#if KDE_IS_VERSION(4,6,0)
KRecentDirs::add(":OpenDialog", QFileInfo(path).dir().canonicalPath());
#endif
}
} else {
KRecentDocument::add(url.url(KUrl::RemoveTrailingSlash), true);
......
......@@ -23,7 +23,6 @@
#include <QFile>
#include <QStandardItemModel>
#include <kdeversion.h>
#include <kcomponentdata.h>
#include <kfileitem.h>
#include <kio/previewjob.h>
......@@ -124,12 +123,8 @@ KisRecentDocumentsPane::KisRecentDocumentsPane(QWidget* parent, const KComponent
m_documentList->selectionModel()->select(firstIndex, QItemSelectionModel::Select);
m_documentList->selectionModel()->setCurrentIndex(firstIndex, QItemSelectionModel::Select);
#if KDE_IS_VERSION(4,6,80)
QStringList availablePlugins = KIO::PreviewJob::availablePlugins();
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, QSize(IconExtent, IconExtent), &availablePlugins);
#else
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, IconExtent, IconExtent, 0);
#endif
d->m_previewJobs.append(previewJob);
connect(previewJob, SIGNAL(result(KJob*)), SLOT(previewResult(KJob*)));
......@@ -155,13 +150,8 @@ void KisRecentDocumentsPane::selectionChanged(const QModelIndex& index)
if (preview.isNull()) {
// need to fetch preview
const KFileItemList fileList = KFileItemList() << fileItem;
#if KDE_IS_VERSION(4,6,80)
QStringList availablePlugins = KIO::PreviewJob::availablePlugins();
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, QSize(PreviewExtent, PreviewExtent), &availablePlugins);
#else
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, PreviewExtent, PreviewExtent, 0);
#endif
d->m_previewJobs.append(previewJob);
connect(previewJob, SIGNAL(result(KJob*)), SLOT(previewResult(KJob*)));
connect(previewJob, SIGNAL(gotPreview(KFileItem,QPixmap)),
......
......@@ -40,7 +40,6 @@
#include <KoJsonTrader.h>
#include <KoConfig.h>
#include <kdeversion.h>
#include <klocale.h>
#include <kcmdlineargs.h>
#include <kdesktopfile.h>
......@@ -52,10 +51,7 @@
#include <kconfig.h>
#include <kglobal.h>
#include <kconfiggroup.h>
#if KDE_IS_VERSION(4,6,0)
#include <krecentdirs.h>
#endif
#include <QFile>
#include <QWidget>
......@@ -301,13 +297,11 @@ bool KoApplication::start()
}
// No argument -> create an empty document
if (!argsCount) {
#if KDE_IS_VERSION(4,6,0)
// if there's no document, add the current working directory
// to the recent dirs so the open dialog and open pane show
// the directory from where the app was started, instead of
// the last directory from where we opened a file
KRecentDirs::add(":OpenDialog", QDir::currentPath());
#endif
QString errorMsg;
KoPart *part = entry.createKoPart(&errorMsg);
d->partList << part;
......
......@@ -61,7 +61,6 @@
#include <kio/job.h>
#include <kdirnotify.h>
#include <ktemporaryfile.h>
#include <kdeversion.h>
#include <QtGlobal>
#include <QBuffer>
......@@ -384,11 +383,7 @@ public:
// this could maybe confuse some apps? So for now we'll just fallback to KIO::get
// and error again. Well, maybe this even helps with wrong stat results.
if (!job->error()) {
#if KDE_IS_VERSION(4,4,0)
const KUrl localUrl = static_cast<KIO::StatJob*>(job)->mostLocalUrl();
#else
const KUrl localUrl = static_cast<KIO::StatJob*>(job)->url();
#endif
if (localUrl.isLocalFile()) {
m_file = localUrl.toLocalFile();
openLocalFile();
......
......@@ -41,10 +41,7 @@
#include <KoIcon.h>
#include <KoConfig.h>
#include <kdeversion.h>
#if KDE_IS_VERSION(4,6,0)
#include <krecentdirs.h>
#endif
#include <khelpmenu.h>
#include <krecentfilesaction.h>
#include <kaboutdata.h>
......@@ -620,9 +617,7 @@ void KoMainWindow::addRecentURL(const KUrl& url)
ok = false; // it's in the tmp resource
if (ok) {
KRecentDocument::add(path);
#if KDE_IS_VERSION(4,6,0)
KRecentDirs::add(":OpenDialog", QFileInfo(path).dir().canonicalPath());
#endif
}
} else {
KRecentDocument::add(url.url(KUrl::RemoveTrailingSlash), true);
......
......@@ -23,7 +23,6 @@
#include <QFile>
#include <QStandardItemModel>
#include <kdeversion.h>
#include <kcomponentdata.h>
#include <kconfiggroup.h>
#include <kurl.h>
......@@ -123,12 +122,8 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, const KComponentDa
m_documentList->selectionModel()->select(firstIndex, QItemSelectionModel::Select);
m_documentList->selectionModel()->setCurrentIndex(firstIndex, QItemSelectionModel::Select);
#if KDE_IS_VERSION(4,6,80)
QStringList availablePlugins = KIO::PreviewJob::availablePlugins();
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, QSize(IconExtent, IconExtent), &availablePlugins);
#else
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, IconExtent, IconExtent, 0);
#endif
d->m_previewJobs.append(previewJob);
connect(previewJob, SIGNAL(result(KJob*)), SLOT(previewResult(KJob*)));
......@@ -154,12 +149,8 @@ void KoRecentDocumentsPane::selectionChanged(const QModelIndex& index)
if (preview.isNull()) {
// need to fetch preview
const KFileItemList fileList = KFileItemList() << fileItem;
#if KDE_IS_VERSION(4,6,80)
QStringList availablePlugins = KIO::PreviewJob::availablePlugins();
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, QSize(PreviewExtent, PreviewExtent), &availablePlugins);
#else
KIO::PreviewJob *previewJob = KIO::filePreview(fileList, PreviewExtent, PreviewExtent, 0);
#endif
d->m_previewJobs.append(previewJob);
connect(previewJob, SIGNAL(result(KJob*)), SLOT(previewResult(KJob*)));
......
......@@ -29,7 +29,6 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#include <kcolorbutton.h>
#include <kconfiggroup.h>
#include <kdeversion.h>
#include <QCheckBox>
#include <QGroupBox>
......@@ -72,9 +71,7 @@ KoConfigGridPage::KoConfigGridPage(KoDocument* doc, char* name)
d->snapChBox = new QCheckBox(generalGrp);
d->snapChBox->setChecked(gd.snapToGrid());
d->gridColorBtn = new KColorButton(gd.gridColor(), generalGrp);
#if KDE_IS_VERSION(4,5,0)
d->gridColorBtn->setAlphaChannelEnabled(true);
#endif
layoutGeneral->addRow(i18n("Show grid:"), d->gridChBox);
layoutGeneral->addRow(i18n("Snap to grid:"), d->snapChBox);
layoutGeneral->addRow(i18n("Grid color:"), d->gridColorBtn);
......
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