summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Mi <codeminister@publicstatic.de>2014-01-19 17:21:20 (GMT)
committerGregor Mi <codeminister@publicstatic.de>2014-01-19 17:21:20 (GMT)
commit43e238d2028c6a8e7b4e6ca42878356c81c95009 (patch)
tree02ada1ebf99a5b175c5e61a9514b305fb35da227
parent14a01a01c3ef90f46df25be3aaac70456670b32b (diff)
remove warnings
-rw-r--r--libksane/ksane_find_devices_thread.h1
-rw-r--r--libksane/ksane_preview_thread.cpp1
-rw-r--r--libksane/ksane_scan_thread.cpp1
-rw-r--r--libksane/ksane_scan_thread.h1
-rw-r--r--libksane/ksane_widget.cpp15
-rw-r--r--libksane/ksane_widget.h1
-rw-r--r--libksane/ksane_widget_private.h16
-rw-r--r--libksane/options/ksane_opt_slider.cpp1
-rw-r--r--libksane/options/ksane_option.cpp19
-rw-r--r--libksane/options/ksane_option.h5
-rw-r--r--libksane/splittercollapser.cpp1
-rw-r--r--libksane/widgets/labeled_slider.cpp14
-rw-r--r--libksane/widgets/labeled_slider.h16
13 files changed, 51 insertions, 41 deletions
diff --git a/libksane/ksane_find_devices_thread.h b/libksane/ksane_find_devices_thread.h
index b610d0f..4e46068 100644
--- a/libksane/ksane_find_devices_thread.h
+++ b/libksane/ksane_find_devices_thread.h
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2007-2008 by Kare Sars <kare dot sars at iki dot fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/libksane/ksane_preview_thread.cpp b/libksane/ksane_preview_thread.cpp
index 1041555..765d300 100644
--- a/libksane/ksane_preview_thread.cpp
+++ b/libksane/ksane_preview_thread.cpp
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2009 by Kare Sars <kare dot sars at iki dot fi>
+* 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/libksane/ksane_scan_thread.cpp b/libksane/ksane_scan_thread.cpp
index bdbbd22..83423df 100644
--- a/libksane/ksane_scan_thread.cpp
+++ b/libksane/ksane_scan_thread.cpp
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2009 by Kare Sars <kare dot sars at iki dot fi>
+* 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/libksane/ksane_scan_thread.h b/libksane/ksane_scan_thread.h
index 54ad7a4..6d8a016 100644
--- a/libksane/ksane_scan_thread.h
+++ b/libksane/ksane_scan_thread.h
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2009 by Kare Sars <kare dot sars at iki dot fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/libksane/ksane_widget.cpp b/libksane/ksane_widget.cpp
index bb05b44..4650d75 100644
--- a/libksane/ksane_widget.cpp
+++ b/libksane/ksane_widget.cpp
@@ -9,6 +9,7 @@
* Copyright (C) 2009 by Matthias Nagl <matthias at nagl dot info>
* Copyright (C) 2009 by Grzegorz Kurtyka <grzegorz dot kurtyka at gmail dot com>
* Copyright (C) 2007-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -75,8 +76,8 @@ KSaneWidget::KSaneWidget(QWidget* parent)
//kDebug() << "The language is:" << KGlobal::locale()->language();
//kDebug() << "Languagelist" << KGlobal::locale()->languageList();
- KGlobal::locale()->insertCatalog("libksane");
- KGlobal::locale()->insertCatalog("sane-backends");
+ //KGlobal::locale()->insertCatalog("libksane"); // FIXME KF5
+ //KGlobal::locale()->insertCatalog("sane-backends"); // FIXME KF5
s_objectMutex.lock();
s_objectCount++;
@@ -125,7 +126,7 @@ KSaneWidget::KSaneWidget(QWidget* parent)
d->m_progressBar = new QProgressBar;
d->m_progressBar->setMaximum(100);
- d->m_cancelBtn = new KPushButton;
+ d->m_cancelBtn = new QPushButton;
d->m_cancelBtn->setIcon(KIcon("process-stop"));
d->m_cancelBtn->setToolTip(i18n("Cancel current scan operation"));
connect(d->m_cancelBtn, SIGNAL(clicked()), this, SLOT(scanCancel()));
@@ -167,13 +168,13 @@ KSaneWidget::KSaneWidget(QWidget* parent)
d->m_clearSelBtn->setToolTip(i18n("Clear Selections"));
connect(d->m_clearSelBtn, SIGNAL(clicked()), d->m_previewViewer, SLOT(clearSelections()));
- d->m_prevBtn = new KPushButton(this);
+ d->m_prevBtn = new QPushButton(this);
d->m_prevBtn->setIcon(KIcon("document-import"));
d->m_prevBtn->setToolTip(i18n("Scan Preview Image"));
d->m_prevBtn->setText(i18nc("Preview button text", "Preview"));
connect(d->m_prevBtn, SIGNAL(clicked()), d, SLOT(startPreviewScan()));
- d->m_scanBtn = new KPushButton(this);
+ d->m_scanBtn = new QPushButton(this);
d->m_scanBtn->setIcon(KIcon("document-save"));
d->m_scanBtn->setToolTip(i18n("Scan Final Image"));
d->m_scanBtn->setText(i18nc("Final scan button text", "Scan"));
@@ -209,10 +210,10 @@ KSaneWidget::KSaneWidget(QWidget* parent)
preview_layout->addWidget(d->m_btnFrame, 0);
// Create Options Widget
- d->m_optsTabWidget = new KTabWidget;
+ d->m_optsTabWidget = new QTabWidget();
// Add the basic options tab
- d->m_basicScrollA = new QScrollArea;
+ d->m_basicScrollA = new QScrollArea();
d->m_basicScrollA->setWidgetResizable(true);
d->m_basicScrollA->setFrameShape(QFrame::NoFrame);
d->m_optsTabWidget->addTab(d->m_basicScrollA, i18n("Basic Options"));
diff --git a/libksane/ksane_widget.h b/libksane/ksane_widget.h
index a8ab81d..27f509e 100644
--- a/libksane/ksane_widget.h
+++ b/libksane/ksane_widget.h
@@ -7,6 +7,7 @@
*
* Copyright (C) 2007-2010 by Kare Sars <kare dot sars at iki dot fi>
* Copyright (C) 2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/libksane/ksane_widget_private.h b/libksane/ksane_widget_private.h
index edc98e1..f097f43 100644
--- a/libksane/ksane_widget_private.h
+++ b/libksane/ksane_widget_private.h
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2009 by Kare Sars <kare dot sars at iki dot fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -35,22 +36,19 @@ extern "C"
#include <sane/sane.h>
}
-// Qt includes
#include <QWidget>
#include <QCheckBox>
#include <QTimer>
#include <QTime>
#include <QProgressBar>
+#include <QTabWidget>
+#include <QPushButton>
-// KDE includes
-#include <KTabWidget>
#include <KLocale>
#include <KDebug>
#include <KMessageBox>
-#include <KPushButton>
#include <KToolBar>
-// Local includes
#include "ksane_widget.h"
#include "ksane_option.h"
#include "ksane_viewer.h"
@@ -111,7 +109,7 @@ namespace KSaneIface
public:
// backend independent
- KTabWidget *m_optsTabWidget;
+ QTabWidget *m_optsTabWidget;
QScrollArea *m_basicScrollA;
QWidget *m_basicOptsTab;
QWidget *m_colorOpts;
@@ -130,13 +128,13 @@ namespace KSaneIface
QToolButton *m_zSelBtn;
QToolButton *m_zFitBtn;
QToolButton *m_clearSelBtn;
- KPushButton *m_scanBtn;
- KPushButton *m_prevBtn;
+ QPushButton *m_scanBtn;
+ QPushButton *m_prevBtn;
QWidget *m_activityFrame;
QLabel *m_warmingUp;
QProgressBar *m_progressBar;
- KPushButton *m_cancelBtn;
+ QPushButton *m_cancelBtn;
// device info
SANE_Handle m_saneHandle;
diff --git a/libksane/options/ksane_opt_slider.cpp b/libksane/options/ksane_opt_slider.cpp
index 5b21570..306748c 100644
--- a/libksane/options/ksane_opt_slider.cpp
+++ b/libksane/options/ksane_opt_slider.cpp
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2009 by Kare Sars <kare dot sars at iki dot fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/libksane/options/ksane_option.cpp b/libksane/options/ksane_option.cpp
index 68eb326..306d997 100644
--- a/libksane/options/ksane_option.cpp
+++ b/libksane/options/ksane_option.cpp
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2009 by Kare Sars <kare dot sars at iki dot fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -308,19 +309,19 @@ KSaneOption::KSaneOptType KSaneOption::optionType(const SANE_Option_Descriptor *
return TYPE_DETECT_FAIL;
}
-KLocalizedString KSaneOption::unitString()
+QString KSaneOption::unitString()
{
switch(m_optDesc->unit)
{
- case SANE_UNIT_NONE: return KLocalizedString();
- case SANE_UNIT_PIXEL: return ki18ncp("SpinBox parameter unit", " Pixel", " Pixels");
- case SANE_UNIT_BIT: return ki18ncp("SpinBox parameter unit", " Bit", " Bits");
- case SANE_UNIT_MM: return ki18nc("SpinBox parameter unit (Millimeter)", " mm");
- case SANE_UNIT_DPI: return ki18nc("SpinBox parameter unit (Dots Per Inch)", " DPI");
- case SANE_UNIT_PERCENT: return ki18nc("SpinBox parameter unit (Percentage)", " %");
- case SANE_UNIT_MICROSECOND: return ki18nc("SpinBox parameter unit (Microseconds)", " µs");
+ case SANE_UNIT_NONE: return QString();
+ case SANE_UNIT_PIXEL: return ki18ncp("SpinBox parameter unit", " Pixel", " Pixels").toString();
+ case SANE_UNIT_BIT: return ki18ncp("SpinBox parameter unit", " Bit", " Bits").toString();
+ case SANE_UNIT_MM: return ki18nc("SpinBox parameter unit (Millimeter)", " mm").toString();
+ case SANE_UNIT_DPI: return ki18nc("SpinBox parameter unit (Dots Per Inch)", " DPI").toString();
+ case SANE_UNIT_PERCENT: return ki18nc("SpinBox parameter unit (Percentage)", " %").toString();
+ case SANE_UNIT_MICROSECOND: return ki18nc("SpinBox parameter unit (Microseconds)", " µs").toString();
}
- return KLocalizedString();
+ return QString();
}
QString KSaneOption::unitDoubleString()
diff --git a/libksane/options/ksane_option.h b/libksane/options/ksane_option.h
index 51ec64f..f46add0 100644
--- a/libksane/options/ksane_option.h
+++ b/libksane/options/ksane_option.h
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2009 by Kare Sars <kare dot sars at iki dot fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -106,7 +107,7 @@ protected:
SANE_Word toSANE_Word(unsigned char *data);
void fromSANE_Word(unsigned char *data, SANE_Word from);
bool writeData(void *data);
- KLocalizedString unitString();
+ QString unitString();
QString unitDoubleString();
void updateVisibility();
@@ -120,3 +121,5 @@ protected:
} // NameSpace KSaneIface
#endif // KSANE_OPTION_H
+
+
diff --git a/libksane/splittercollapser.cpp b/libksane/splittercollapser.cpp
index 5584572..b03c9fc 100644
--- a/libksane/splittercollapser.cpp
+++ b/libksane/splittercollapser.cpp
@@ -3,6 +3,7 @@
Gwenview: an image viewer
Copyright 2009 Aurélien Gâteau <agateau@kde.org>
Copyright 2009 Kåre Sårs <kare.sars@iki.fi>
+2014: Gregor Mitsch: port to KDE5 frameworks
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/libksane/widgets/labeled_slider.cpp b/libksane/widgets/labeled_slider.cpp
index 7a7ca7e..15c8c03 100644
--- a/libksane/widgets/labeled_slider.cpp
+++ b/libksane/widgets/labeled_slider.cpp
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2007-2011 by Kare Sars <kare.sars@iki .fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -25,16 +26,12 @@
*
* ============================================================ */
-// Local includes
#include "labeled_slider.h"
#include "labeled_slider.moc"
-// KDE includes
-#include <KNumInput>
-
-// Qt includes
#include <QLabel>
#include <QSlider>
+#include <QSpinBox>
namespace KSaneIface
{
@@ -52,7 +49,7 @@ LabeledSlider::LabeledSlider(QWidget *parent, const QString& ltext,
m_slider->setMaximum(max);
m_slider->setSingleStep(m_step);
- m_spinb = new KIntSpinBox(this);
+ m_spinb = new QSpinBox(this);
m_spinb->setMinimum(min);
m_spinb->setMaximum(max);
m_slider->setSingleStep(m_step);
@@ -79,7 +76,7 @@ LabeledSlider::~LabeledSlider()
{
}
-void LabeledSlider::setSuffix(const KLocalizedString &text)
+void LabeledSlider::setSuffix(const QString &text)
{
m_spinb->setSuffix(text);
}
@@ -137,5 +134,8 @@ void LabeledSlider::fixValue()
m_spinb->setValue(m_slider->value());
}
}
+int LabeledSlider::value() const {
+ return( m_slider->value());
+}
} // NameSpace KSaneIface
diff --git a/libksane/widgets/labeled_slider.h b/libksane/widgets/labeled_slider.h
index f59c925..e7bea31 100644
--- a/libksane/widgets/labeled_slider.h
+++ b/libksane/widgets/labeled_slider.h
@@ -6,6 +6,7 @@
* Description : Sane interface for KDE
*
* Copyright (C) 2007-2011 by Kare Sars <kare.sars@iki .fi>
+ * 2014: Gregor Mitsch: port to KDE5 frameworks
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -30,8 +31,8 @@
#include "ksane_option_widget.h"
-// Qt includes
-#include <QSlider>
+class QSlider;
+class QSpinBox;
/**
*@author Kåre Särs
@@ -67,7 +68,7 @@ public:
int min, int max, int st);
~LabeledSlider();
- int value() const { return( m_slider->value()); }
+ int value() const;
public Q_SLOTS:
@@ -76,7 +77,7 @@ public Q_SLOTS:
void setRange(int min, int max);
void setStep(int);
/** Set the unit */
- void setSuffix(const KLocalizedString &text);
+ void setSuffix(const QString &text);
private Q_SLOTS:
@@ -93,10 +94,9 @@ Q_SIGNALS:
void valueChanged(int);
private:
-
- QSlider *m_slider;
- KIntSpinBox *m_spinb;
- int m_step;
+ QSlider *m_slider;
+ QSpinBox *m_spinb;
+ int m_step;
};
} // NameSpace KSaneIface