#include <KIO/NetAccess>
#include <QDir>
-#include <qscriptengine.h>
+#include <QScriptEngine>
#include <QCloseEvent>
#include <QScriptEngine>
connect(m_view.button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteProfile()));
connect(m_view.button_default, SIGNAL(clicked()), this, SLOT(slotSetDefaultProfile()));
- connect(m_view.description, SIGNAL(textChanged(const QString &)), this, SLOT(slotProfileEdited()));
+ connect(m_view.description, SIGNAL(textChanged(QString)), this, SLOT(slotProfileEdited()));
connect(m_view.frame_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
connect(m_view.frame_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
connect(m_view.aspect_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
slotUpdateDisplay(profilePath);
connect(m_view.button_save, SIGNAL(clicked()), this, SLOT(slotSaveProfile()));
- connect(m_view.description, SIGNAL(textChanged(const QString &)), this, SLOT(slotProfileEdited()));
+ connect(m_view.description, SIGNAL(textChanged(QString)), this, SLOT(slotProfileEdited()));
connect(m_view.frame_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
connect(m_view.frame_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
connect(m_view.aspect_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
m_profileIsModified = true;
}
-void ProfilesDialog::fillList(const QString selectedProfile)
+void ProfilesDialog::fillList(const QString &selectedProfile)
{
// List the Mlt profiles
m_view.profiles_list->clear();
}
if (!KdenliveSettings::default_profile().isEmpty()) {
- for (int i = 0; i < m_view.profiles_list->count(); i++) {
+ for (int i = 0; i < m_view.profiles_list->count(); ++i) {
if (m_view.profiles_list->itemData(i).toString() == KdenliveSettings::default_profile()) {
m_view.profiles_list->setCurrentIndex(i);
break;
QString profilePath = KStandardDirs::locateLocal("appdata", customName + QString::number(i));
kDebug() << " TYING PROFILE FILE: " << profilePath;
while (KIO::NetAccess::exists(KUrl(profilePath), KIO::NetAccess::SourceSide, this)) {
- i++;
+ ++i;
profilePath = KStandardDirs::locateLocal("appdata", customName + QString::number(i));
}
saveProfile(profilePath);
return true;
}
-void ProfilesDialog::saveProfile(const QString path)
+void ProfilesDialog::saveProfile(QString path)
{
QFile file(path);
if (!file.open(QIODevice::WriteOnly)) {
}
// static
-MltVideoProfile ProfilesDialog::getVideoProfile(QString name)
+MltVideoProfile ProfilesDialog::getVideoProfile(const QString &name)
{
MltVideoProfile result;
QStringList profilesNames;
}
// static
-double ProfilesDialog::getStringEval(const MltVideoProfile &profile, QString eval, QPoint frameSize)
+double ProfilesDialog::getStringEval(const MltVideoProfile &profile, QString eval, const QPoint& frameSize)
{
QScriptEngine sEngine;
sEngine.globalObject().setProperty("maxWidth", profile.width > frameSize.x() ? profile.width : frameSize.x());
}
// static
-QString ProfilesDialog::existingProfile(MltVideoProfile profile)
+QString ProfilesDialog::existingProfile(const MltVideoProfile &profile)
{
// Check if the profile has a matching entry in existing ones
QStringList profilesFilter;
}
// static
-QMap< QString, QString > ProfilesDialog::getSettingsFromFile(const QString path)
+QMap< QString, QString > ProfilesDialog::getSettingsFromFile(const QString& path)
{
QStringList profilesNames;
QStringList profilesFiles;
}
// static
-QMap< QString, QString > ProfilesDialog::getSettingsForProfile(const QString profileName)
+QMap< QString, QString > ProfilesDialog::getSettingsForProfile(const QString& profileName)
{
QStringList profilesNames;
QStringList profilesFiles;
}
// static
-bool ProfilesDialog::matchProfile(int width, int height, double fps, double par, bool isImage, MltVideoProfile profile)
+bool ProfilesDialog::matchProfile(int width, int height, double fps, double par, bool isImage, const MltVideoProfile &profile)
{
int profileWidth;
if (isImage) {
}
// static
-QString ProfilesDialog::getPathFromDescription(const QString profileDesc)
+QString ProfilesDialog::getPathFromDescription(const QString& profileDesc)
{
QStringList profilesNames;
QStringList profilesFiles;
profilePath = KStandardDirs::locateLocal("appdata", customName + QString::number(i));
kDebug() << " TYING PROFILE FILE: " << profilePath;
while (KIO::NetAccess::exists(KUrl(profilePath), KIO::NetAccess::SourceSide, 0)) {
- i++;
+ ++i;
profilePath = KStandardDirs::locateLocal("appdata", customName + QString::number(i));
}
}
m_view.profiles_list->blockSignals(false);
return;
}
-
+ QLocale locale;
m_selectedProfileIndex = m_view.profiles_list->currentIndex();
- if (currentProfile.isEmpty()) currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
+ if (currentProfile.isEmpty())
+ currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
m_isCustomProfile = currentProfile.contains('/');
m_view.button_create->setEnabled(true);
m_view.button_delete->setEnabled(m_isCustomProfile);
m_view.frame_den->setValue(values.value("frame_rate_den").toInt());
m_view.progressive->setChecked(values.value("progressive").toInt());
if (values.value("progressive").toInt()) {
- m_view.fields->setText(QString::number((double) values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
+ m_view.fields->setText(locale.toString((double) values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
} else {
- m_view.fields->setText(QString::number((double) 2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
+ m_view.fields->setText(locale.toString((double) 2 * values.value("frame_rate_num").toInt() / values.value("frame_rate_den").toInt(), 'f', 2));
}
int colorix = m_view.colorspace->findData(values.value("colorspace").toInt());