Remove KGlobal and last KFileDialog

parent f5f20987
......@@ -24,7 +24,6 @@
#include <QDebug>
#include <KMessageBox>
#include <KGlobal>
#include <QDir>
#include <QScriptEngine>
......
......@@ -28,7 +28,6 @@
#include <KMessageBox>
#include <KApplication>
#include <KLocalizedString>
#include <KGlobal>
#include <QFile>
#include <QColor>
......
......@@ -42,7 +42,6 @@
#include <KIO/CopyJob>
#include <KIO/JobUiDelegate>
#include <KApplication>
#include <KGlobal>
#include <KBookmarkManager>
#include <KBookmark>
......@@ -1664,7 +1663,7 @@ void KdenliveDoc::updateProjectFolderPlacesEntry()
KBookmark bookmark = root.first();
QString kdenliveName = KGlobal::mainComponent().componentName();
QString kdenliveName = QCoreApplication::applicationName();
QUrl documentLocation = m_projectFolder;
bool exists = false;
......
......@@ -25,14 +25,14 @@
#include <mlt++/Mlt.h>
#include <QDebug>
#include <KGlobal>
#include <KConfigGroup>
#include <kio/global.h>
#include <KSharedConfig>
#include <KIO/Global>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QDomDocument>
#include <QMimeData>
#include <QTreeWidgetItem>
#include <QHeaderView>
#include <unistd.h>
......
......@@ -24,7 +24,6 @@
#include "mainwindow.h"
#include <QDebug>
#include <kglobal.h>
#include <QFile>
#include <QDir>
......
......@@ -14,9 +14,10 @@ the Free Software Foundation, either version 3 of the License, or
#include "mainwindow.h"
#include <QMenu>
#include <QInputDialog>
#include <KConfigGroup>
#include <KXMLGUIFactory>
#include <KGlobal>
#include <KSharedConfig>
LayoutManagement::LayoutManagement(QObject* parent) :
QObject(parent)
......@@ -44,7 +45,7 @@ void LayoutManagement::initializeLayouts()
{
QMenu *saveLayout = static_cast<QMenu*>(pCore->window()->factory()->container("layout_save_as", pCore->window()));
if (m_loadLayout == NULL || saveLayout == NULL) return;
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup layoutGroup(config, "Layouts");
QStringList entries = layoutGroup.keyList();
QList<QAction *> loadActions = m_loadLayout->actions();
......@@ -85,7 +86,7 @@ void LayoutManagement::slotLoadLayout(QAction *action)
return;
}
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup layouts(config, "Layouts");
QByteArray state = QByteArray::fromBase64(layouts.readEntry(layoutId).toAscii());
pCore->window()->restoreState(state);
......@@ -101,7 +102,7 @@ void LayoutManagement::slotSaveLayout(QAction *action)
if (layoutName.isEmpty()) {
return;
}
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup layouts(config, "Layouts");
layouts.deleteEntry(originallayoutName);
......
......@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
QApplication app(argc, argv);
QApplication app(argc, argv);
app.setOrganizationDomain("kde.org");
KDBusService programDBusService;
......
......@@ -31,7 +31,6 @@
#include <kdeversion.h>
#include <KRun>
#include <QFontDatabase>
#include <KGlobal>
#ifdef USE_NEPOMUK
#if KDE_IS_VERSION(4,6,0)
......
......@@ -23,7 +23,6 @@ the Free Software Foundation, either version 3 of the License, or
#include "effectstack/effectstackview2.h"
#include "project/dialogs/backupwidget.h"
#include "project/notesplugin.h"
#include <KFileDialog>
#include <KActionCollection>
#include <QAction>
#include <KMessageBox>
......
......@@ -19,8 +19,8 @@
#include <QMouseEvent>
#include <QPainter>
#include <KLocale>
#include <KConfigGroup>
#include <KGlobal>
#include <KSharedConfig>
// Uncomment for Scope debugging.
......@@ -125,7 +125,7 @@ void AbstractScopeWidget::init()
void AbstractScopeWidget::readConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
m_aAutoRefresh->setChecked(scopeConfig.readEntry("autoRefresh", true));
m_aRealtime->setChecked(scopeConfig.readEntry("realtime", false));
......@@ -134,7 +134,7 @@ void AbstractScopeWidget::readConfig()
void AbstractScopeWidget::writeConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
scopeConfig.writeEntry("autoRefresh", m_aAutoRefresh->isChecked());
scopeConfig.writeEntry("realtime", m_aRealtime->isChecked());
......
......@@ -18,7 +18,7 @@
#include <QPainter>
#include <QTime>
#include <KGlobal>
#include <KSharedConfig>
#include <KConfigGroup>
#include <iostream>
......@@ -112,7 +112,7 @@ void AudioSpectrum::readConfig()
{
AbstractScopeWidget::readConfig();
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, AbstractScopeWidget::configName());
ui->windowSize->setCurrentIndex(scopeConfig.readEntry("windowSize", 0));
......@@ -132,7 +132,7 @@ void AudioSpectrum::readConfig()
}
void AudioSpectrum::writeConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, AbstractScopeWidget::configName());
scopeConfig.writeEntry("windowSize", ui->windowSize->currentIndex());
......
......@@ -11,7 +11,7 @@
#include <QPainter>
#include <QTime>
#include <KGlobal>
#include <KSharedConfig>
#include <KConfigGroup>
#include "spectrogram.h"
......@@ -107,7 +107,7 @@ void Spectrogram::readConfig()
{
AbstractScopeWidget::readConfig();
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, AbstractScopeWidget::configName());
ui->windowSize->setCurrentIndex(scopeConfig.readEntry("windowSize", 0));
......@@ -128,7 +128,7 @@ void Spectrogram::readConfig()
}
void Spectrogram::writeConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, AbstractScopeWidget::configName());
scopeConfig.writeEntry("windowSize", ui->windowSize->currentIndex());
......
......@@ -12,7 +12,7 @@
#include "histogramgenerator.h"
#include <QTime>
#include <KGlobal>
#include <KSharedConfig>
#include <KSharedConfigPtr>
#include <KConfigGroup>
......@@ -68,7 +68,7 @@ void Histogram::readConfig()
{
AbstractGfxScopeWidget::readConfig();
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
ui->cbY->setChecked(scopeConfig.readEntry("yEnabled", true));
ui->cbS->setChecked(scopeConfig.readEntry("sEnabled", false));
......@@ -81,7 +81,7 @@ void Histogram::readConfig()
void Histogram::writeConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
scopeConfig.writeEntry("yEnabled", ui->cbY->isChecked());
scopeConfig.writeEntry("sEnabled", ui->cbS->isChecked());
......
......@@ -13,7 +13,8 @@
#include <QPainter>
#include <QRect>
#include <QTime>
#include <KGlobal>
#include <KSharedConfig>
#include <KSharedConfigPtr>
#include <KConfigGroup>
......@@ -59,7 +60,7 @@ void RGBParade::readConfig()
{
AbstractGfxScopeWidget::readConfig();
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
ui->paintMode->setCurrentIndex(scopeConfig.readEntry("paintmode", 0));
m_aAxis->setChecked(scopeConfig.readEntry("axis", false));
......@@ -68,7 +69,7 @@ void RGBParade::readConfig()
void RGBParade::writeConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
scopeConfig.writeEntry("paintmode", ui->paintMode->currentIndex());
scopeConfig.writeEntry("axis", m_aAxis->isChecked());
......
......@@ -17,7 +17,7 @@
#include <QAction>
#include <QDebug>
#include <QPainter>
#include <KGlobal>
#include <KSharedConfig>
#include <KConfigGroup>
#include <QTime>
......@@ -141,7 +141,7 @@ void Vectorscope::readConfig()
{
AbstractGfxScopeWidget::readConfig();
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
m_a75PBox->setChecked(scopeConfig.readEntry("75PBox", false));
m_aAxisEnabled->setChecked(scopeConfig.readEntry("axis", false));
......@@ -155,7 +155,7 @@ void Vectorscope::readConfig()
void Vectorscope::writeConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
scopeConfig.writeEntry("75PBox", m_a75PBox->isChecked());
scopeConfig.writeEntry("axis", m_aAxisEnabled->isChecked());
......
......@@ -16,7 +16,7 @@
#include <QPainter>
#include <QPoint>
#include <KGlobal>
#include <KSharedConfig>
const QSize Waveform::m_textWidth(35,0);
const int Waveform::m_paddingBottom(20);
......@@ -69,7 +69,7 @@ void Waveform::readConfig()
{
AbstractGfxScopeWidget::readConfig();
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
ui->paintMode->setCurrentIndex(scopeConfig.readEntry("paintmode", 0));
m_aRec601->setChecked(scopeConfig.readEntry("rec601", false));
......@@ -78,7 +78,7 @@ void Waveform::readConfig()
void Waveform::writeConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup scopeConfig(config, configName());
scopeConfig.writeEntry("paintmode", ui->paintMode->currentIndex());
scopeConfig.writeEntry("rec601", m_aRec601->isChecked());
......
......@@ -33,7 +33,6 @@
#include <QMouseEvent>
#include <QDesktopWidget>
#include <kglobal.h>
#include <klocale.h>
#include <QDebug>
......
......@@ -22,14 +22,12 @@
#include <cmath>
#include <QDebug>
#include <QFontDatabase>
#include <KFileDialog>
#include <KGlobal>
#include <KMessageBox>
#include <kdeversion.h>
#include <QDebug>
#include <QFontDatabase>
#include <QFileDialog>
#include <QDomDocument>
#include <QGraphicsItem>
#include <QGraphicsSvgItem>
......@@ -655,7 +653,7 @@ void TitleWidget::slotImageTool()
{
// TODO: find a way to get a list of all supported image types...
QString allExtensions = "image/gif image/jpeg image/png image/x-tga image/x-bmp image/svg+xml image/tiff image/x-xcf-gimp image/x-vnd.adobe.photoshop image/x-pcx image/x-exr";
QUrl url = KFileDialog::getOpenUrl(QUrl(), allExtensions, this, i18n("Load Image")); //"*.svg *.png *.jpg *.jpeg *.gif *.raw"
QUrl url = QFileDialog::getOpenFileUrl(this, i18n("Load Image"), QUrl(), allExtensions); //"*.svg *.png *.jpg *.jpeg *.gif *.raw"
if (!url.isEmpty()) {
if (url.path().endsWith(QLatin1String(".svg"))) {
QGraphicsSvgItem *svg = new QGraphicsSvgItem(url.toLocalFile());
......@@ -1688,7 +1686,7 @@ void TitleWidget::itemRight()
void TitleWidget::loadTitle(QUrl url)
{
if (url.isEmpty()) url = KFileDialog::getOpenUrl(QUrl(m_projectTitlePath), "application/x-kdenlivetitle", this, i18n("Load Title"));
if (url.isEmpty()) url = QFileDialog::getOpenFileUrl(this, i18n("Load Title"), QUrl(m_projectTitlePath), "application/x-kdenlivetitle");
if (!url.isEmpty()) {
QList<QGraphicsItem *> items = m_scene->items();
for (int i = 0; i < items.size(); ++i) {
......@@ -1741,13 +1739,13 @@ void TitleWidget::saveTitle(QUrl url)
embed_image=false;
}
if (url.isEmpty()) {
QPointer<KFileDialog> fs = new KFileDialog(QUrl(m_projectTitlePath), "application/x-kdenlivetitle", this);
fs->setOperationMode(KFileDialog::Saving);
fs->setMode(KFile::File);
fs->setConfirmOverwrite(true);
fs->setKeepLocation(true);
if (fs->exec()) {
url = fs->selectedUrl();
QPointer<QFileDialog> fs = new QFileDialog(this, i18n("Save Title"), m_projectTitlePath, "application/x-kdenlivetitle");
fs->setFileMode(QFileDialog::AnyFile);
//TODO: KF5 porting?
//fs->setConfirmOverwrite(true);
//fs->setKeepLocation(true);
if (fs->exec() && !fs->selectedUrls().isEmpty()) {
url = fs->selectedUrls().first();
}
delete fs;
}
......
......@@ -9,13 +9,14 @@
#include "unicodedialog.h"
#include <KGlobal>
#include <QWheelEvent>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <KSharedConfig>
/// CONSTANTS
const int MAX_LENGTH_HEX = 4;
......@@ -293,7 +294,7 @@ QString UnicodeWidget::nextUnicode(const QString &text, Direction direction)
void UnicodeWidget::readChoices()
{
// Get a pointer to a shared configuration instance, then get the TitleWidget group.
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup titleConfig(config, "TitleWidget");
// Default is 2013 because there is also (perhaps interesting) information.
......@@ -303,7 +304,7 @@ void UnicodeWidget::readChoices()
void UnicodeWidget::writeChoices()
{
// Get a pointer to a shared configuration instance, then get the TitleWidget group.
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup titleConfig(config, "TitleWidget");
titleConfig.writeEntry("unicode_number", m_lastUnicodeNumber);
......
......@@ -29,12 +29,12 @@
#include <QListWidget>
#include <QAction>
#include <QMenu>
#include <QFileDialog>
#include <KGlobal>
#include <KSharedConfig>
#include <QDebug>
#include <kdeversion.h>
#include <QFontDatabase>
#include <KFileDialog>
#include <kio/job.h>
#include <KIO/SimpleJob>
#include <Solid/Networking>
......@@ -131,7 +131,7 @@ ResourceWidget::~ResourceWidget()
void ResourceWidget::loadConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup resourceConfig(config, "ResourceWidget");
QList<int> size;
size << 100 << 400;
......@@ -140,7 +140,7 @@ void ResourceWidget::loadConfig()
void ResourceWidget::saveConfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup resourceConfig(config, "ResourceWidget");
resourceConfig.writeEntry(QLatin1String("mainsplitter"), splitter->size());
config->sync();
......@@ -268,7 +268,7 @@ void ResourceWidget::slotSaveItem(const QString &originalUrl)
path.append(m_currentService->getDefaultDownloadName(item));
ext = m_currentService->getExtension(search_results->currentItem());
}
QString saveUrl = KFileDialog::getSaveFileName(QUrl(path), ext);
QString saveUrl = QFileDialog::getSaveFileName(this, QString(), path, ext);
QUrl srcUrl(m_currentInfo.itemDownload);
if (saveUrl.isEmpty() || !QFile::exists(srcUrl.path()))
return;
......
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