Remove more kde4support stuff

parent ba0764e5
......@@ -100,7 +100,6 @@ list(APPEND kdenlive_SRCS
layoutmanagement.cpp
hidetitlebars.cpp
mltconnection.cpp
core.cpp
)
......@@ -245,14 +244,6 @@ target_link_libraries(kdenlive
KF5::Notifications
KF5::TextWidgets
KF5::IconThemes
#KF5::Service
#KF5::KIONTLM
#${KDE4_KDEUI_LIBS}
#${KDE4_KIO_LIBS}
#${KDE4_KNEWSTUFF_LIBS}
#${KDE4_KNOTIFYCONFIG_LIBRARY}
#${KDE4_KROSSUI_LIBS}
#${KDE4_SOLID_LIBS}
${Qt5_LIBRARIES}
Qt5::Svg
${OPENGL_LIBRARIES}
......
......@@ -29,7 +29,7 @@ class MonitorManager;
* Plugins should be loaded after the widget setup.
*/
class KDENLIVECORE_EXPORT Core : public QObject
class /*KDENLIVECORE_EXPORT*/ Core : public QObject
{
Q_OBJECT
......
......@@ -29,8 +29,6 @@
#endif
#include "klocalizedstring.h"
#include <kde_file.h>
#include <kdeversion.h>
#include <KMessageBox>
#include <KLineEdit>
#include <QDebug>
......
......@@ -198,13 +198,11 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, const
m_view.errorIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(height, height));
m_view.errorBox->setHidden(true);
#if KDE_IS_VERSION(4,7,0)
m_infoMessage = new KMessageWidget;
QGridLayout *s = static_cast <QGridLayout*> (m_view.tab->layout());
s->addWidget(m_infoMessage, 16, 0, 1, -1);
m_infoMessage->setCloseButtonVisible(false);
m_infoMessage->hide();
#endif
m_view.encoder_threads->setMaximum(QThread::idealThreadCount());
m_view.encoder_threads->setValue(KdenliveSettings::encodethreads());
......@@ -328,9 +326,7 @@ RenderWidget::~RenderWidget()
m_view.scripts_list->clear();
delete m_jobsDelegate;
delete m_scriptsDelegate;
#if KDE_IS_VERSION(4,7,0)
delete m_infoMessage;
#endif
}
void RenderWidget::slotEditItem(QListWidgetItem *item)
......@@ -2256,37 +2252,17 @@ void RenderWidget::missingClips(bool hasMissing)
void RenderWidget::errorMessage(const QString &message)
{
if (!message.isEmpty()) {
#if KDE_IS_VERSION(4,7,0)
m_infoMessage->setMessageType(KMessageWidget::Warning);
m_infoMessage->setText(message);
#if KDE_IS_VERSION(4,10,0)
m_infoMessage->animatedShow();
#else
// Workaround KDE bug in KMessageWidget
QTimer::singleShot(0, m_infoMessage, SLOT(animatedShow()));
#endif
#else
m_view.errorLabel->setText(message);
m_view.errorBox->setHidden(false);
#endif
}
else {
#if KDE_IS_VERSION(4,7,0)
if (m_view.tabWidget->currentIndex() == 0 && m_infoMessage->isVisible()) {
#if KDE_IS_VERSION(4,10,0)
m_infoMessage->animatedHide();
#else
QTimer::singleShot(0, m_infoMessage, SLOT(animatedHide()));
#endif
} else {
// Seems like animated hide does not work when page is not visible
m_infoMessage->hide();
}
#else
m_view.errorBox->setHidden(true);
m_view.errorLabel->setText(QString());
#endif
}
}
......
......@@ -21,10 +21,7 @@
#ifndef RENDERWIDGET_H
#define RENDERWIDGET_H
#include <kdeversion.h>
#if KDE_IS_VERSION(4,7,0)
#include <KMessageWidget>
#endif
#include <QPushButton>
#include <QPainter>
......@@ -190,10 +187,7 @@ private:
RenderViewDelegate *m_jobsDelegate;
bool m_blockProcessing;
QString m_renderer;
#if KDE_IS_VERSION(4,7,0)
KMessageWidget *m_infoMessage;
#endif
void parseProfiles(const QString &meta = QString(), const QString &group = QString(), const QString &profile = QString());
void parseFile(const QString &exportFile, bool editable);
......
......@@ -29,7 +29,7 @@
#include <mlt++/Mlt.h>
#include <QDebug>
#include <klocale.h>
#include <klocalizedstring.h>
#include <kfileitem.h>
#include <kmessagebox.h>
......@@ -363,7 +363,6 @@ void KThumb::slotCreateAudioThumbs()
m_clipManager->askForAudioThumb(m_id);
}
#if KDE_IS_VERSION(4,5,0)
void KThumb::queryIntraThumbs(const QSet <int> &missingFrames)
{
m_intraMutex.lock();
......@@ -426,7 +425,6 @@ QImage KThumb::findCachedThumb(int pos)
m_clipManager->pixmapCache->findImage(path, &img);
return img;
}
#endif
......@@ -23,8 +23,6 @@
#include <QFuture>
#include <QUrl>
#include <kdeversion.h>
#include <mlt++/Mlt.h>
......@@ -60,12 +58,10 @@ public:
void updateThumbUrl(const QString &hash);
void extractImage(const QList<int> &frames);
QImage extractImage(int frame, int width, int height);
#if KDE_IS_VERSION(4,5,0)
/** @brief Request thumbnails for the frame range. */
void queryIntraThumbs(const QSet <int> &missingFrames);
/** @brief Query cached thumbnail. */
QImage findCachedThumb(int pos);
#endif
void getThumb(int frame);
void getGenericThumb(int frame, int height, int type);
......@@ -87,10 +83,8 @@ public:
static uint imageVariance(const QImage &image);
private slots:
#if KDE_IS_VERSION(4,5,0)
/** @brief Fetch all requested frames. */
void slotGetIntraThumbs();
#endif
private:
QUrl m_url;
......
......@@ -87,12 +87,10 @@ DvdWizard::DvdWizard(MonitorManager *manager, const QString &url, QWidget *paren
m_status.iso_image->setFilter("*.iso");
m_status.iso_image->setMode(KFile::File);
#if KDE_IS_VERSION(4,7,0)
m_isoMessage = new KMessageWidget;
QGridLayout *s = static_cast <QGridLayout*> (page4->layout());
s->addWidget(m_isoMessage, 5, 0, 1, -1);
m_isoMessage->hide();
#endif
addPage(page4);
......@@ -181,9 +179,7 @@ void DvdWizard::slotprepareMonitor()
void DvdWizard::generateDvd()
{
#if KDE_IS_VERSION(4,7,0)
m_isoMessage->animatedHide();
#endif
m_status.error_box->setHidden(true);
m_status.error_box->setCurrentIndex(0);
m_status.menu_file->clear();
......@@ -338,15 +334,9 @@ void DvdWizard::processSpumux()
QProcess spumux;
QString menuMovieUrl;
#if QT_VERSION >= 0x040600
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("VIDEO_FORMAT", m_pageVob->dvdFormat() == PAL || m_pageVob->dvdFormat() == PAL_WIDE ? "PAL" : "NTSC");
spumux.setProcessEnvironment(env);
#else
QStringList env = QProcess::systemEnvironment();
env << QString("VIDEO_FORMAT=") + QString(m_pageVob->dvdFormat() == PAL || m_pageVob->dvdFormat() == PAL_WIDE ? "PAL" : "NTSC");
spumux.setEnvironment(env);
#endif
if (m_pageMenu->menuMovie()) spumux.setStandardInputFile(m_menuFinalVideo.fileName());
else spumux.setStandardInputFile(m_menuVideo.fileName());
......@@ -654,15 +644,9 @@ void DvdWizard::processDvdauthor(const QString &menuMovieUrl, const QMap <QStrin
m_creationLog.clear();
m_dvdauthor = new QProcess(this);
// Set VIDEO_FORMAT variable (required by dvdauthor 0.7)
#if QT_VERSION >= 0x040600
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("VIDEO_FORMAT", m_pageVob->dvdFormat() == PAL || m_pageVob->dvdFormat() == PAL_WIDE ? "PAL" : "NTSC");
m_dvdauthor->setProcessEnvironment(env);
#else
QStringList env = QProcess::systemEnvironment();
env << QString("VIDEO_FORMAT=") + QString(m_pageVob->dvdFormat() == PAL || m_pageVob->dvdFormat() == PAL_WIDE ? "PAL" : "NTSC");
m_dvdauthor->setEnvironment(env);
#endif
connect(m_dvdauthor, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotRenderFinished(int,QProcess::ExitStatus)));
connect(m_dvdauthor, SIGNAL(readyReadStandardOutput()), this, SLOT(slotShowRenderInfo()));
m_dvdauthor->setProcessChannelMode(QProcess::MergedChannels);
......@@ -696,19 +680,15 @@ void DvdWizard::slotShowRenderInfo()
}
void DvdWizard::errorMessage(const QString &text) {
#if KDE_IS_VERSION(4,7,0)
m_isoMessage->setText(text);
m_isoMessage->setMessageType(KMessageWidget::Error);
m_isoMessage->animatedShow();
#endif
}
void DvdWizard::infoMessage(const QString &text) {
#if KDE_IS_VERSION(4,7,0)
m_isoMessage->setText(text);
m_isoMessage->setMessageType(KMessageWidget::Positive);
m_isoMessage->animatedShow();
#endif
}
void DvdWizard::slotRenderFinished(int exitCode, QProcess::ExitStatus status)
......
......@@ -47,10 +47,7 @@ private:
DvdWizardVob *m_pageVob;
DvdWizardMenu *m_pageMenu;
Ui::DvdWizardStatus_UI m_status;
#if KDE_IS_VERSION(4,7,0)
KMessageWidget *m_isoMessage;
#endif
DvdWizardChapters *m_pageChapters;
QTemporaryFile m_authorFile;
......
......@@ -86,7 +86,6 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) :
QFont font = m_view.font_family->currentFont();
font.setPixelSize(m_view.font_size->value());
//font.setStyleStrategy(QFont::NoAntialias);
#if KDE_IS_VERSION(4,6,0)
if (m_view.use_shadow->isChecked()) {
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
shadow->setBlurRadius(7);
......@@ -94,9 +93,6 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) :
button->setGraphicsEffect(shadow);
}
connect(m_view.use_shadow, SIGNAL(stateChanged(int)), this, SLOT(slotEnableShadows(int)));
#elif KDE_IS_VERSION(4,6,0)
m_view.use_shadow->setHidden(true);
#endif
button->setFont(font);
button->setDefaultTextColor(m_view.text_color->color());
button->setZValue(4);
......@@ -135,14 +131,11 @@ DvdWizardMenu::DvdWizardMenu(DVDFORMAT format, QWidget *parent) :
m_view.error_message->setPalette(p);
m_view.menu_box->setEnabled(false);
#if KDE_IS_VERSION(4,7,0)
m_menuMessage = new KMessageWidget;
QGridLayout *s = static_cast <QGridLayout*> (layout());
s->addWidget(m_menuMessage, 7, 0, 1, -1);
m_menuMessage->hide();
m_view.error_message->hide();
#endif
}
DvdWizardMenu::~DvdWizardMenu()
......@@ -155,7 +148,6 @@ DvdWizardMenu::~DvdWizardMenu()
void DvdWizardMenu::slotEnableShadows(int enable)
{
#if KDE_IS_VERSION(4,6,0)
QList<QGraphicsItem *> list = m_scene->items();
for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->type() == DvdButtonItem) {
......@@ -168,7 +160,6 @@ void DvdWizardMenu::slotEnableShadows(int enable)
else list.at(i)->setGraphicsEffect(NULL);
}
}
#endif
}
// virtual
......@@ -188,14 +179,9 @@ bool DvdWizardMenu::isComplete() const
if (!collisions.isEmpty()) {
for (int j = 0; j < collisions.count(); ++j) {
if (collisions.at(j)->type() == button->type()) {
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->setText(i18n("Buttons overlapping"));
m_menuMessage->setMessageType(KMessageWidget::Warning);
m_menuMessage->show();
#else
m_view.error_message->setText(i18n("Buttons overlapping"));
m_view.error_message->setHidden(false);
#endif
return false;
}
}
......@@ -205,35 +191,24 @@ bool DvdWizardMenu::isComplete() const
}
if (buttonCount == 0) {
//We need at least one button
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->setText(i18n("No button in menu"));
m_menuMessage->setMessageType(KMessageWidget::Warning);
m_menuMessage->show();
#else
m_view.error_message->setText(i18n("No button in menu"));
m_view.error_message->setHidden(false);
#endif
return false;
}
if (!m_view.background_image->isHidden()) {
// Make sure user selected a valid image / video file
if (!QFile::exists(m_view.background_image->url().path())) {
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->setText(i18n("Missing background image"));
m_menuMessage->setMessageType(KMessageWidget::Warning);
m_menuMessage->show();
#else
m_view.error_message->setText(i18n("Missing background image"));
m_view.error_message->setHidden(false);
#endif
return false;
}
}
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->hide();
#endif
// check that we have a "Play all" entry
if (targets.contains(0)) return true;
......@@ -241,14 +216,9 @@ bool DvdWizardMenu::isComplete() const
for (int i = m_view.target_list->count() - 1; i > 0; --i) {
// If there is a vob file entry and it has no button assigned, don't allow to go further
if (m_view.target_list->itemIcon(i).isNull() == false && !targets.contains(i)) {
#if KDE_IS_VERSION(4,7,0)
m_menuMessage->setText(i18n("No menu entry for %1", m_view.target_list->itemText(i)));
m_menuMessage->setMessageType(KMessageWidget::Warning);
m_menuMessage->show();
#else
m_view.error_message->setText(i18n("No menu entry for %1", m_view.target_list->itemText(i)));
m_view.error_message->setHidden(false);
#endif
return false;
}
}
......@@ -318,14 +288,12 @@ void DvdWizardMenu::addButton()
DvdButton *button = new DvdButton(m_view.play_text->text());
QFont font = m_view.font_family->currentFont();
font.setPixelSize(m_view.font_size->value());
#if KDE_IS_VERSION(4,6,0)
if (m_view.use_shadow->isChecked()) {
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
shadow->setBlurRadius(7);
shadow->setOffset(4, 4);
button->setGraphicsEffect(shadow);
}
#endif
//font.setStyleStrategy(QFont::NoAntialias);
button->setFont(font);
button->setDefaultTextColor(m_view.text_color->color());
......@@ -579,48 +547,29 @@ void DvdWizardMenu::createButtonImages(const QString &selected_image, const QStr
if (m_color->scene() != 0) m_scene->removeItem(m_color);
if (m_background->scene() != 0) m_scene->removeItem(m_background);
prepareUnderLines();
#if QT_VERSION >= 0x040800
QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_ARGB32);
img.fill(Qt::transparent);
updateUnderlineColor(m_view.highlighted_color->color());
#else
QImage img(m_finalSize.width(), m_finalSize.height(), QImage::Format_Mono);
img.fill(Qt::white);
updateUnderlineColor(Qt::black);
#endif
QPainter p;
p.begin(&img);
//p.setRenderHints(QPainter::Antialiasing, false);
//p.setRenderHints(QPainter::TextAntialiasing, false);
m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
p.end();
#if QT_VERSION >= 0x040800
#elif QT_VERSION >= 0x040600
img.setColor(0, m_view.highlighted_color->color().rgb());
img.setColor(1, qRgba(0,0,0,0));
#else
img.setNumColors(4);
#endif
img.save(highlighted_image);
#if QT_VERSION >= 0x040800
img.fill(Qt::transparent);
updateUnderlineColor(m_view.selected_color->color());
#else
img.fill(Qt::white);
#endif
p.begin(&img);
//p.setRenderHints(QPainter::Antialiasing, false);
//p.setRenderHints(QPainter::TextAntialiasing, false);
m_scene->render(&p, target, source, Qt::IgnoreAspectRatio);
p.end();
#if QT_VERSION >= 0x040800
#elif QT_VERSION >= 0x040600
img.setColor(0, m_view.selected_color->color().rgb());
img.setColor(1, qRgba(0,0,0,0));
#else
img.setNumColors(4);
#endif
img.save(selected_image);
resetUnderLines();
m_scene->addItem(m_safeRect);
......@@ -814,14 +763,12 @@ void DvdWizardMenu::loadXml(DVDFORMAT format, const QDomElement &xml)
DvdButton *button = new DvdButton(e.attribute("text"));
QFont font(e.attribute("font_family"));
font.setPixelSize(e.attribute("font_size").toInt());
#if KDE_IS_VERSION(4,6,0)
if (m_view.use_shadow->isChecked()) {
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
shadow->setBlurRadius(7);
shadow->setOffset(4, 4);
button->setGraphicsEffect(shadow);
}
#endif
//font.setStyleStrategy(QFont::NoAntialias);
button->setFont(font);
......
......@@ -32,11 +32,7 @@
#include <QDomElement>
#include <QDebug>
#include <kdeversion.h>
#if KDE_IS_VERSION(4,7,0)
#include <KMessageWidget>
#endif
class DvdScene : public QGraphicsScene
{
......@@ -182,9 +178,7 @@ private:
int m_height;
QSize m_finalSize;
int m_movieLength;
#if KDE_IS_VERSION(4,7,0)
KMessageWidget *m_menuMessage;
#endif
private slots:
void buildButton();
......
......@@ -119,7 +119,6 @@ DvdWizardVob::DvdWizardVob(QWidget *parent) :
m_transcodeAction = new QAction(i18n("Transcode"), this);
connect(m_transcodeAction, SIGNAL(triggered()), this, SLOT(slotTranscodeFiles()));
#if KDE_IS_VERSION(4,7,0)
m_warnMessage = new KMessageWidget;
m_warnMessage->setCloseButtonVisible(false);
QGridLayout *s = static_cast <QGridLayout*> (layout());
......@@ -135,14 +134,6 @@ DvdWizardVob::DvdWizardVob(QWidget *parent) :
m_warnMessage->hide();
}
m_view.button_transcode->setHidden(true);
#else
m_view.button_transcode->setDefaultAction(m_transcodeAction);
m_view.button_transcode->setEnabled(false);
if (!errorMessage.isEmpty()) {
m_view.error_message->setText(errorMessage);
m_installCheck = false;
}
#endif
slotCheckVobList();
}
......@@ -167,12 +158,8 @@ void DvdWizardVob::slotCheckProfiles()
if (conflict) {
showProfileError();
}
else {
#if KDE_IS_VERSION(4,7,0)
else {
m_warnMessage->animatedHide();
#else
if (m_installCheck) m_view.error_message->setVisible(false);
#endif
}
}
......@@ -658,28 +645,18 @@ void DvdWizardVob::slotTranscodedClip(QUrl src, QUrl transcoded)
void DvdWizardVob::showProfileError()
{
#if KDE_IS_VERSION(4,7,0)
m_warnMessage->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
m_warnMessage->setCloseButtonVisible(false);
m_warnMessage->addAction(m_transcodeAction);
m_warnMessage->animatedShow();
#else
m_view.error_message->setText(i18n("Your clips do not match selected DVD format, transcoding required."));
m_view.error_message->setVisible(true);
#endif
}
void DvdWizardVob::showError(const QString &error)
{
#if KDE_IS_VERSION(4,7,0)
m_warnMessage->setText(error);
m_warnMessage->setCloseButtonVisible(true);
m_warnMessage->removeAction(m_transcodeAction);
m_warnMessage->animatedShow();
#else
m_view.error_message->setText(error);
m_view.error_message->setVisible(true);
#endif
}
......
......@@ -22,14 +22,10 @@
#define DVDWIZARDVOB_H
#include "ui_dvdwizardvob_ui.h"
#include <kdeversion.h>
#include <kcapacitybar.h>
#include <QUrl>
#if KDE_IS_VERSION(4,7,0)
#include <KMessageWidget>
#endif
#include <QWizardPage>
#include <QStyledItemDelegate>
......@@ -127,9 +123,7 @@ private:
KCapacityBar *m_capacityBar;
QAction *m_transcodeAction;
bool m_installCheck;
#if KDE_IS_VERSION(4,7,0)
KMessageWidget *m_warnMessage;
#endif
void showProfileError();
void showError(const QString &error);
......
......@@ -18,7 +18,7 @@
#ifndef InitEffects_H
#define InitEffects_H
#include <klocale.h>
#include <klocalizedstring.h>
#include <QDomDocument>
#include <QThread>
#include <mlt++/Mlt.h>
......
......@@ -25,7 +25,6 @@
#include <QHBoxLayout>
#include <KColorButton>
#include <kdeversion.h>
#include <QDebug>
static QColor stringToColor(QString strColor)
......@@ -101,9 +100,7 @@ ChooseColorWidget::ChooseColorWidget(const QString &text, const QString &color,
rightSideLayout->setSpacing(0);
m_button = new KColorButton(stringToColor(color), rightSide);
#if KDE_IS_VERSION(4,5,0)
if (alphaEnabled) m_button->setAlphaChannelEnabled(alphaEnabled);
#endif
// m_button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
ColorPickerWidget *picker = new ColorPickerWidget(rightSide);
......@@ -121,9 +118,7 @@ ChooseColorWidget::ChooseColorWidget(const QString &text, const QString &color,
QString ChooseColorWidget::getColor() const
{
bool alphaChannel = false;
#if KDE_IS_VERSION(4,5,0)
alphaChannel = m_button->isAlphaChannelEnabled();
#endif
return colorToString(m_button->color(), alphaChannel);
}
......
......@@ -45,7 +45,7 @@
// KDE includes.
#include <kcursor.h>
#include <klocale.h>
#include <klocalizedstring.h>
#define bounds(x,a,b) (x<a ? a : (x>b ? b :x))
#define MOUSE_AWAY_THRES 15
......
......@@ -22,7 +22,6 @@
#include "jogshuttle.h"
#include <QDebug>
#include <kde_file.h>
#include <QApplication>
#include <QEvent>
......
......@@ -21,7 +21,7 @@
#define _KDENLIVECORE_EXPORT_H
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
#ifndef KDENLIVECORE_EXPORT
# if defined(KDELIBS_STATIC_LIBS)
......
......@@ -77,14 +77,8 @@
#include <QMenu>