No more Kde4Support, Qt5/KF5 port is almost done

parent 1764e230
......@@ -77,7 +77,7 @@ check_include_files(pthread.h HAVE_PTHREAD_H)
find_package(Qt5 CONFIG REQUIRED Core DBus Test Widgets Script Svg OpenGL)
find_package(KF5 REQUIRED Archive Bookmarks CoreAddons Config ConfigWidgets
DBusAddons KIO KDELibs4Support WidgetsAddons Plotting NotifyConfig NewStuff XmlGui )
DBusAddons KIO WidgetsAddons Plotting NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes )
#Service)
......
......@@ -14,9 +14,11 @@ include_directories(
#include(${QT_USE_FILE})
qt5_use_modules(kdenlive_render Widgets Concurrent DBus)
target_link_libraries(kdenlive_render
${QT_LIBRARIES}
KF5::KDELibs4Support
${Qt5_LIBRARIES}
)
install(TARGETS kdenlive_render DESTINATION ${BIN_INSTALL_DIR})
......@@ -104,7 +104,7 @@ list(APPEND kdenlive_SRCS
core.cpp
)
kde4_add_ui_files(kdenlive_UIS
qt5_wrap_ui(kdenlive_UIS
ui/addtrack_ui.ui
ui/archivewidget_ui.ui
ui/audiospectrum_ui.ui
......@@ -194,12 +194,12 @@ if(BUILD_JogShuttle)
)
endif(BUILD_JogShuttle)
qt4_add_dbus_adaptor(kdenlive_SRCS
qt5_add_dbus_adaptor(kdenlive_SRCS
org.kdenlive.MainWindow.xml
mainwindow.h
MainWindow
)
qt4_add_resources(kdenlive_SRCS ui/resources.qrc)
qt5_add_resources(kdenlive_SRCS ui/resources.qrc)
add_executable(kdenlive
${kdenlive_SRCS}
${kdenlive_UIS}
......@@ -230,7 +230,6 @@ include_directories(
target_link_libraries(kdenlive
KF5::KDELibs4Support
KF5::WidgetsAddons
KF5::Plotting
KF5::Archive
......@@ -242,6 +241,10 @@ target_link_libraries(kdenlive
KF5::NewStuff
KF5::DBusAddons
KF5::XmlGui
KF5::GuiAddons
KF5::Notifications
KF5::TextWidgets
KF5::IconThemes
#KF5::Service
#KF5::KIONTLM
#${KDE4_KDEUI_LIBS}
......@@ -252,7 +255,7 @@ target_link_libraries(kdenlive
#${KDE4_SOLID_LIBS}
${Qt5_LIBRARIES}
Qt5::Svg
#Qt5:OpenGL
${OPENGL_LIBRARIES}
${QT_LIBRARIES}
${MLT_LIBRARIES}
${MLTPP_LIBRARIES}
......
......@@ -24,6 +24,7 @@
#include <QDebug>
#include <QFontDatabase>
#include <KFileItem>
#include "klocalizedstring.h"
#include <QTreeWidgetItem>
#include <QFile>
......
......@@ -18,8 +18,7 @@
***************************************************************************/
#include "definitions.h"
#include <KLocale>
#include <klocalizedstring.h>
QDebug operator << (QDebug qd, const ItemInfo &info)
{
......
......@@ -21,8 +21,9 @@
#include "kdenlivesettings.h"
#include <QDebug>
#include "klocalizedstring.h"
#include <QDebug>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QPlainTextEdit>
......
......@@ -28,12 +28,12 @@
#include "capture/v4lcapture.h"
#endif
#include <QDebug>
#include "klocalizedstring.h"
#include <kde_file.h>
#include <kdeversion.h>
#include <KMessageBox>
#include <KLineEdit>
#include <QDebug>
#include <QDir>
#include <QTimer>
#include <QThread>
......@@ -791,7 +791,7 @@ void KdenliveSettingsDialog::updateSettings()
actions << m_mappable_actions[button->currentText()];
}
QString maps = JogShuttleConfig::actionMap(actions);
//fprintf(stderr, "Shuttle config: %s\n", JogShuttleConfig::actionMap(actions).toAscii().constData());
//fprintf(stderr, "Shuttle config: %s\n", JogShuttleConfig::actionMap(actions).toLatin1().constData());
if (KdenliveSettings::shuttlebuttons() != maps)
KdenliveSettings::setShuttlebuttons(maps);
#endif
......
......@@ -18,18 +18,18 @@
***************************************************************************/
#include "profilesdialog.h"
#include "kdenlivesettings.h"
#include <QDebug>
#include <KMessageBox>
#include <KMessageBox>
#include "klocalizedstring.h"
#include <QDir>
#include <QScriptEngine>
#include <QCloseEvent>
#include <QScriptEngine>
#include <QStandardPaths>
#include <QDebug>
ProfilesDialog::ProfilesDialog(QWidget * parent) :
QDialog(parent),
......
......@@ -24,14 +24,13 @@
#include "timecode.h"
#include "dialogs/profilesdialog.h"
#include <QDebug>
#include "klocalizedstring.h"
#include <KMessageBox>
#include <KRun>
#include <KColorScheme>
#include <KNotification>
#include <QDebug>
#include <QDomDocument>
#include <QTreeWidgetItem>
#include <QListWidgetItem>
......@@ -286,15 +285,15 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, const
m_view.running_jobs->setItemDelegate(m_jobsDelegate);
QHeaderView *header = m_view.running_jobs->header();
header->setResizeMode(0, QHeaderView::Fixed);
header->setSectionResizeMode(0, QHeaderView::Fixed);
header->resizeSection(0, 30);
header->setResizeMode(1, QHeaderView::Interactive);
header->setSectionResizeMode(1, QHeaderView::Interactive);
m_view.scripts_list->setHeaderLabels(QStringList() << QString() << i18n("Script Files"));
m_scriptsDelegate = new RenderViewDelegate(this);
m_view.scripts_list->setItemDelegate(m_scriptsDelegate);
header = m_view.scripts_list->header();
header->setResizeMode(0, QHeaderView::Fixed);
header->setSectionResizeMode(0, QHeaderView::Fixed);
header->resizeSection(0, 30);
// Find path for Kdenlive renderer
......
......@@ -31,7 +31,7 @@
#include <framework/mlt_version.h>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <KProcess>
#include <KRun>
#include <KMessageWidget>
......
......@@ -1067,8 +1067,8 @@ bool DocClipBase::checkHash() const
QString DocClipBase::getClipHash() const
{
QString hash;
if (m_clipType == SlideShow) hash = QCryptographicHash::hash(m_properties.value("resource").toAscii().data(), QCryptographicHash::Md5).toHex();
else if (m_clipType == Color) hash = QCryptographicHash::hash(m_properties.value("colour").toAscii().data(), QCryptographicHash::Md5).toHex();
if (m_clipType == SlideShow) hash = QCryptographicHash::hash(m_properties.value("resource").toLatin1().data(), QCryptographicHash::Md5).toHex();
else if (m_clipType == Color) hash = QCryptographicHash::hash(m_properties.value("colour").toLatin1().data(), QCryptographicHash::Md5).toHex();
else if (m_clipType == Text) hash = QCryptographicHash::hash(QString("title" + getId() + m_properties.value("xmldata")).toUtf8().data(), QCryptographicHash::Md5).toHex();
else {
if (m_properties.contains("file_hash")) hash = m_properties.value("file_hash");
......
......@@ -20,7 +20,7 @@
#include "doccommands.h"
#include "kdenlivedoc.h"
#include <KLocalizedString>
#include <klocalizedstring.h>
AddClipCommand::AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent) :
QUndoCommand(parent),
......
......@@ -26,9 +26,11 @@
#include "definitions.h"
#include "kdenlivesettings.h"
#include <QDebug>
#include <KUrlRequesterDialog>
#include <KMessageBox>
#include <klocalizedstring.h>
#include <QDebug>
#include <QFontDatabase>
#include <QTreeWidgetItem>
#include <QFile>
......
......@@ -26,7 +26,7 @@
#include <QDebug>
#include <KMessageBox>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <QFile>
#include <QColor>
......
......@@ -37,7 +37,7 @@
#include <KMessageBox>
#include <QProgressDialog>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <KIO/CopyJob>
#include <KIO/JobUiDelegate>
#include <KBookmarkManager>
......@@ -52,6 +52,7 @@
#include <QUndoGroup>
#include <QTimer>
#include <QUndoStack>
#include <QTextEdit>
#include <mlt++/Mlt.h>
#include <KJobWidgets/KJobWidgets>
......
......@@ -42,7 +42,7 @@ class MainWindow;
class TrackInfo;
class NotesPlugin;
class KTextEdit;
class QTextEdit;
class QProgressDialog;
class QUndoGroup;
class QTimer;
......@@ -177,7 +177,7 @@ private:
int m_height;
Timecode m_timecode;
Render *m_render;
KTextEdit *m_notesWidget;
QTextEdit *m_notesWidget;
QUndoStack *m_commandStack;
ClipManager *m_clipManager;
MltVideoProfile m_profile;
......
......@@ -255,7 +255,7 @@ uint KThumb::imageVariance(const QImage &image )
{
uint delta = 0;
uint avg = 0;
uint bytes = image.numBytes();
uint bytes = image.byteCount();
uint STEPS = bytes/2;
QVarLengthArray<uchar> pivot(STEPS);
const uchar *bits=image.bits();
......
......@@ -27,7 +27,7 @@
#include "monitor/monitormanager.h"
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <KMessageBox>
#include <QFile>
......
......@@ -23,10 +23,8 @@
#include <QDebug>
#include <KColorScheme>
#if KDE_IS_VERSION(4,6,0)
#include "klocalizedstring.h"
#include <QGraphicsDropShadowEffect>
#endif
#include "doc/kthumb.h"
......
......@@ -28,6 +28,7 @@
#include <KConfigGroup>
#include <KSharedConfig>
#include <KIO/Global>
#include "klocalizedstring.h"
#include <QFileDialog>
#include <QHBoxLayout>
......@@ -105,9 +106,9 @@ DvdWizardVob::DvdWizardVob(QWidget *parent) :
connect(m_view.dvd_profile, SIGNAL(activated(int)), this, SLOT(slotCheckProfiles()));
m_vobList->header()->setStretchLastSection(false);
m_vobList->header()->setResizeMode(0, QHeaderView::Stretch);
m_vobList->header()->setResizeMode(1, QHeaderView::Custom);
m_vobList->header()->setResizeMode(2, QHeaderView::Custom);
m_vobList->header()->setSectionResizeMode(0, QHeaderView::Stretch);
m_vobList->header()->setSectionResizeMode(1, QHeaderView::Custom);
m_vobList->header()->setSectionResizeMode(2, QHeaderView::Custom);
m_capacityBar = new KCapacityBar(KCapacityBar::DrawTextInline, this);
QHBoxLayout *lay = new QHBoxLayout;
......
......@@ -73,7 +73,7 @@ public:
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
QPixmap pixmap = qVariantValue<QPixmap>(index.data(Qt::DecorationRole));
QPixmap pixmap = index.data(Qt::DecorationRole).value<QPixmap>();
QPoint pixmapPoint(r1.left() + textMargin, r1.top() + (r1.height() - pixmap.height()) / 2);
painter->drawPixmap(pixmapPoint, pixmap);
int decoWidth = pixmap.width() + 2 * textMargin;
......
......@@ -19,7 +19,7 @@
#include "effectslist.h"
#include <QDebug>
#include <KLocalizedString>
#include <klocalizedstring.h>
EffectsList::EffectsList(bool indexRequired) : m_useIndex(indexRequired)
......
......@@ -25,7 +25,7 @@
#include "kdenlivesettings.h"
#include <QDebug>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <QMenu>
#include <QDir>
......
......@@ -22,9 +22,8 @@
#include "effectslist/effectslist.h"
#include "mainwindow.h"
#include "klocalizedstring.h"
#include <QDebug>
#include <QAction>
#include <QMenu>
#include <QMimeData>
......
......@@ -442,7 +442,7 @@ QDomDocument initEffects::createDescriptionFromMlt(Mlt::Repository* repository,
{
QDomDocument ret;
Mlt::Properties *metadata = repository->metadata(filter_type, filtername.toAscii().data());
Mlt::Properties *metadata = repository->metadata(filter_type, filtername.toLatin1().data());
////qDebug() << filtername;
if (metadata && metadata->is_valid()) {
if (metadata->get("title") && metadata->get("identifier")) {
......
......@@ -36,7 +36,7 @@
#include <QDebug>
#include <KComboBox>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <KMessageBox>
#include <QStandardPaths>
......
......@@ -31,7 +31,7 @@
#include <QDebug>
#include <QFontDatabase>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <KMessageBox>
#include <KColorScheme>
#include <QStandardPaths>
......
......@@ -18,7 +18,7 @@
#include "complexparameter.h"
#include <QDebug>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <QHeaderView>
......
......@@ -34,7 +34,7 @@
#include <QDebug>
#include <QIcon>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <QFontDatabase>
......
......@@ -30,7 +30,7 @@
#include "monitor/monitorscene.h"
#include <QDebug>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <KColorScheme>
#include <QFontDatabase>
#include <KColorUtils>
......
......@@ -17,11 +17,11 @@
#include "geometryval.h"
#include "graphicsscenerectmove.h"
#include "kdenlivesettings.h"
#include <QDebug>
#include "klocalizedstring.h"
#include <QDebug>
#include <QGraphicsView>
#include <QVBoxLayout>
#include <QGraphicsRectItem>
......
......@@ -18,12 +18,11 @@
#include "keyframeedit.h"
#include "positionedit.h"
#include "widgets/doubleparameterwidget.h"
#include "kdenlivesettings.h"
#include "klocalizedstring.h"
#include <QDebug>
#include <QFontDatabase>
#include <QHeaderView>
KeyframeEdit::KeyframeEdit(const QDomElement &e, int minFrame, int maxFrame, const Timecode &tc, int activeKeyframe, QWidget* parent) :
......
......@@ -49,6 +49,7 @@
#include "ui_fontval_ui.h"
#include <KUrlRequester>
#include "klocalizedstring.h"
#include <QMap>
#include <QString>
......
......@@ -25,7 +25,7 @@
#include <QIcon>
#include <QLabel>
#include <KLocalizedString>
#include <klocalizedstring.h>
BezierSplineWidget::BezierSplineWidget(const QString& spline, QWidget* parent) :
......
......@@ -29,7 +29,7 @@
#include <QTimer>
#include <QIcon>
#include <QDebug>
#include <KLocalizedString>
#include <klocalizedstring.h>
#ifdef Q_WS_X11
#include <X11/Xutil.h>
......
......@@ -27,7 +27,7 @@
#include "onmonitoritems/onmonitorcornersitem.h"
#include <QGraphicsView>
#include "klocalizedstring.h"
#include <QIcon>
inline int lerp( const int a, const int b, double t )
......
......@@ -31,13 +31,13 @@
#include "onmonitoritems/onmonitorrectitem.h"
#include "onmonitoritems/onmonitorpathitem.h"
#include "klocalizedstring.h"
#include <QGraphicsView>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QMenu>
GeometryWidget::GeometryWidget(Monitor* monitor, const Timecode &timecode, int clipPos, bool showRotation, QWidget* parent):
QWidget(parent),
m_monitor(monitor),
......
......@@ -57,7 +57,7 @@
//static bool pointLessThan(const QPointF &a, const QPointF &b);
KisCurveWidget::KisCurveWidget(QWidget *parent, Qt::WFlags f)
KisCurveWidget::KisCurveWidget(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f), d(new KisCurveWidget::Private(this))
{
setObjectName("KisCurveWidget");
......
......@@ -53,7 +53,7 @@ public:
* Create a new curve widget with a default curve, that is a straight
* line from bottom-left to top-right.
*/
explicit KisCurveWidget(QWidget *parent = 0, Qt::WFlags f = 0);
explicit KisCurveWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
virtual ~KisCurveWidget();
......
......@@ -13,7 +13,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "core.h"
#include "mainwindow.h"
#include "kdenlivesettings.h"
#include <klocalizedstring.h>
HideTitleBars::HideTitleBars(QObject* parent) :
QObject(parent)
......
......@@ -46,7 +46,7 @@ void JogManager::slotDoAction(const QString& actionName)
{
QAction* action = pCore->window()->actionCollection()->action(actionName);
if (!action) {
fprintf(stderr, "%s", QString("shuttle action '%1' unknown\n").arg(actionName).toAscii().constData());
fprintf(stderr, "%s", QString("shuttle action '%1' unknown\n").arg(actionName).toLatin1().constData());
return;
}
action->trigger();
......
......@@ -45,18 +45,18 @@ QStringList JogShuttleConfig::actionMap(const QString& actionsConfig)
foreach (const QString& mapping, mappings) {
QStringList parts = mapping.split(KEY_VALUE_SEP);
if (parts.size() != 2) {
fprintf(stderr, "Invalid button configuration: %s", mapping.toAscii().constData());
fprintf(stderr, "Invalid button configuration: %s", mapping.toLatin1().constData());
continue;
}
// skip the 'button' prefix
int button_id = parts[0].mid(BUTTON_PREFIX.length()).toInt();
//fprintf(stderr, " - Handling map key='%s' (ID=%d), value='%s'\n", parts[0].data().toAscii(), button_id, parts[1].data().toAscii()); // DBG
//fprintf(stderr, " - Handling map key='%s' (ID=%d), value='%s'\n", parts[0].data().toLatin1(), button_id, parts[1].data().toLatin1()); // DBG
while (actionMap.size() <= button_id)
actionMap << QString();
actionMap[button_id] = parts[1];
}
//for (int i = 0; i < actionMap.size(); ++i) fprintf(stderr, "button #%d -> action '%s'\n", i, actionMap[i].data().toAscii()); //DBG
//for (int i = 0; i < actionMap.size(); ++i) fprintf(stderr, "button #%d -> action '%s'\n", i, actionMap[i].data().toLatin1()); //DBG
return actionMap;
}
......
......@@ -18,6 +18,7 @@ the Free Software Foundation, either version 3 of the License, or
#include <KConfigGroup>
#include <KXMLGUIFactory>
#include <KSharedConfig>
#include <klocalizedstring.h>
LayoutManagement::LayoutManagement(QObject* parent) :
QObject(parent)
......@@ -88,7 +89,7 @@ void LayoutManagement::slotLoadLayout(QAction *action)
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup layouts(config, "Layouts");
QByteArray state = QByteArray::fromBase64(layouts.readEntry(layoutId).toAscii());
QByteArray state = QByteArray::fromBase64(layouts.readEntry(layoutId).toLatin1());
pCore->window()->restoreState(state);
}
......
......@@ -11,7 +11,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "audioCorrelation.h"
#include "fftCorrelation.h"
#include <KLocale>
#include "klocalizedstring.h"
#include <QDebug>
#include <QTime>
#include <cmath>
......
......@@ -27,7 +27,7 @@
#include <QUrl> //new
#include <QApplication>
#include <KLocalizedString>
#include <klocalizedstring.h>
#include <KDBusService>
#include <QCommandLineParser>
#include <QCommandLineOption>
......
......@@ -61,7 +61,6 @@
#endif
#include <QAction>
#include <KLocalizedString>
#include <KActionCollection>
#include <KActionCategory>
#include <KActionMenu>
......@@ -72,7 +71,7 @@
#include <KConfigDialog>
#include <KXMLGUIFactory>
#include <KColorSchemeManager>
#include <KStatusBar>
#include <QStatusBar>
#include <KUrlRequesterDialog>
#include <QTemporaryFile>
#include <QMenu>
......
......@@ -35,7 +35,6 @@
#include <kautosavefile.h>
#include <KActionCategory>
#include <KSelectAction>
#include <KSharedConfigPtr>
#include <KColorSchemeManager>
#include "kdenlivecore_export.h"
......
......@@ -15,6 +15,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "mainwindow.h"
#include <config-kdenlive.h>
#include <KUrlRequesterDialog>
#include <klocalizedstring.h>
#include <QFile>
#include <QStandardPaths>
......
......@@ -30,7 +30,7 @@
#include "twostateaction.h"
#include <QDebug>
#include <KLocalizedString>
#include "klocalizedstring.h"
#include <QMouseEvent>
#include <QMenu>
......
......@@ -29,8 +29,8 @@
#include <QVBoxLayout>
#include <QAction>
#include <QToolButton>