Commit a2b0d699 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

Gardening: fix GCC warnings (4)

parent ff8ecee3
......@@ -145,9 +145,9 @@ void EncodingProfilesDialog::slotAddProfile()
QListWidgetItem *item = profile_list->currentItem();
if (item) {
QString data = item->data(Qt::UserRole).toString();
pparams->setPlainText(data.section(QLatin1Char(';'), 0, 0));
pext->setText(data.section(QLatin1Char(';'), 1, 1));
QString profilestr = item->data(Qt::UserRole).toString();
pparams->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
pext->setText(profilestr.section(QLatin1Char(';'), 1, 1));
}
if (d->exec() == QDialog::Accepted) {
m_configGroup->writeEntry(pname->text(), pparams->toPlainText() + QLatin1Char(';') + pext->text());
......@@ -178,9 +178,9 @@ void EncodingProfilesDialog::slotEditProfile()
QListWidgetItem *item = profile_list->currentItem();
if (item) {
pname->setText(item->text());
QString data = item->data(Qt::UserRole).toString();
pparams->setPlainText(data.section(QLatin1Char(';'), 0, 0));
pext->setText(data.section(QLatin1Char(';'), 1, 1));
QString profilestr = item->data(Qt::UserRole).toString();
pparams->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
pext->setText(profilestr.section(QLatin1Char(';'), 1, 1));
pparams->setFocus();
}
if (d->exec() == QDialog::Accepted) {
......
......@@ -566,13 +566,13 @@ void KdenliveSettingsDialog::slotReadAudioDevices()
//qCDebug(KDENLIVE_LOG) << "// / / / / / READING APLAY: ";
//qCDebug(KDENLIVE_LOG) << result;
const QStringList lines = result.split(QLatin1Char('\n'));
for (const QString &data : lines) {
for (const QString &devicestr : lines) {
////qCDebug(KDENLIVE_LOG) << "// READING LINE: " << data;
if (!data.startsWith(QLatin1Char(' ')) && data.count(QLatin1Char(':')) > 1) {
QString card = data.section(QLatin1Char(':'), 0, 0).section(QLatin1Char(' '), -1);
QString device = data.section(QLatin1Char(':'), 1, 1).section(QLatin1Char(' '), -1);
m_configSdl.kcfg_audio_device->addItem(data.section(QLatin1Char(':'), -1).simplified(), "plughw:" + card + QLatin1Char(',') + device);
m_configCapture.kcfg_v4l_alsadevice->addItem(data.section(QLatin1Char(':'), -1).simplified(), "hw:" + card + QLatin1Char(',') + device);
if (!devicestr.startsWith(QLatin1Char(' ')) && devicestr.count(QLatin1Char(':')) > 1) {
QString card = devicestr.section(QLatin1Char(':'), 0, 0).section(QLatin1Char(' '), -1);
QString device = devicestr.section(QLatin1Char(':'), 1, 1).section(QLatin1Char(' '), -1);
m_configSdl.kcfg_audio_device->addItem(devicestr.section(QLatin1Char(':'), -1).simplified(), "plughw:" + card + QLatin1Char(',') + device);
m_configCapture.kcfg_v4l_alsadevice->addItem(devicestr.section(QLatin1Char(':'), -1).simplified(), "hw:" + card + QLatin1Char(',') + device);
}
}
}
......@@ -761,54 +761,54 @@ void KdenliveSettingsDialog::updateSettings()
updateCapturePath = true;
}
if ((uint) m_configCapture.kcfg_firewireformat->currentIndex() != KdenliveSettings::firewireformat()) {
if (m_configCapture.kcfg_firewireformat->currentIndex() != KdenliveSettings::firewireformat()) {
KdenliveSettings::setFirewireformat(m_configCapture.kcfg_firewireformat->currentIndex());
updateCapturePath = true;
}
if ((uint) m_configCapture.kcfg_v4l_format->currentIndex() != KdenliveSettings::v4l_format()) {
if (m_configCapture.kcfg_v4l_format->currentIndex() != KdenliveSettings::v4l_format()) {
saveCurrentV4lProfile();
KdenliveSettings::setV4l_format(0);
}
// Check if screengrab is fullscreen
if ((uint) m_configCapture.kcfg_grab_capture_type->currentIndex() != KdenliveSettings::grab_capture_type()) {
if (m_configCapture.kcfg_grab_capture_type->currentIndex() != KdenliveSettings::grab_capture_type()) {
KdenliveSettings::setGrab_capture_type(m_configCapture.kcfg_grab_capture_type->currentIndex());
emit updateFullScreenGrab();
}
// Check encoding profiles
// FFmpeg
QString data = m_configCapture.kcfg_v4l_profile->itemData(m_configCapture.kcfg_v4l_profile->currentIndex()).toString();
if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::v4l_parameters() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::v4l_extension())) {
KdenliveSettings::setV4l_parameters(data.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setV4l_extension(data.section(QLatin1Char(';'), 1, 1));
QString profilestr = m_configCapture.kcfg_v4l_profile->itemData(m_configCapture.kcfg_v4l_profile->currentIndex()).toString();
if (!profilestr.isEmpty() && (profilestr.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::v4l_parameters() || profilestr.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::v4l_extension())) {
KdenliveSettings::setV4l_parameters(profilestr.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setV4l_extension(profilestr.section(QLatin1Char(';'), 1, 1));
}
// screengrab
data = m_configCapture.kcfg_grab_profile->itemData(m_configCapture.kcfg_grab_profile->currentIndex()).toString();
if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::grab_parameters() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::grab_extension())) {
KdenliveSettings::setGrab_parameters(data.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setGrab_extension(data.section(QLatin1Char(';'), 1, 1));
profilestr = m_configCapture.kcfg_grab_profile->itemData(m_configCapture.kcfg_grab_profile->currentIndex()).toString();
if (!profilestr.isEmpty() && (profilestr.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::grab_parameters() || profilestr.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::grab_extension())) {
KdenliveSettings::setGrab_parameters(profilestr.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setGrab_extension(profilestr.section(QLatin1Char(';'), 1, 1));
}
// decklink
data = m_configCapture.kcfg_decklink_profile->itemData(m_configCapture.kcfg_decklink_profile->currentIndex()).toString();
if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::decklink_parameters() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::decklink_extension())) {
KdenliveSettings::setDecklink_parameters(data.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setDecklink_extension(data.section(QLatin1Char(';'), 1, 1));
profilestr = m_configCapture.kcfg_decklink_profile->itemData(m_configCapture.kcfg_decklink_profile->currentIndex()).toString();
if (!profilestr.isEmpty() && (profilestr.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::decklink_parameters() || profilestr.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::decklink_extension())) {
KdenliveSettings::setDecklink_parameters(profilestr.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setDecklink_extension(profilestr.section(QLatin1Char(';'), 1, 1));
}
// proxies
data = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile->currentIndex()).toString();
if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::proxyparams() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::proxyextension())) {
KdenliveSettings::setProxyparams(data.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setProxyextension(data.section(QLatin1Char(';'), 1, 1));
profilestr = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile->currentIndex()).toString();
if (!profilestr.isEmpty() && (profilestr.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::proxyparams() || profilestr.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::proxyextension())) {
KdenliveSettings::setProxyparams(profilestr.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setProxyextension(profilestr.section(QLatin1Char(';'), 1, 1));
}
// timeline preview
data = m_configProject.kcfg_preview_profile->itemData(m_configProject.kcfg_preview_profile->currentIndex()).toString();
if (!data.isEmpty() && (data.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::previewparams() || data.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::previewextension())) {
KdenliveSettings::setPreviewparams(data.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setPreviewextension(data.section(QLatin1Char(';'), 1, 1));
profilestr = m_configProject.kcfg_preview_profile->itemData(m_configProject.kcfg_preview_profile->currentIndex()).toString();
if (!profilestr.isEmpty() && (profilestr.section(QLatin1Char(';'), 0, 0) != KdenliveSettings::previewparams() || profilestr.section(QLatin1Char(';'), 1, 1) != KdenliveSettings::previewextension())) {
KdenliveSettings::setPreviewparams(profilestr.section(QLatin1Char(';'), 0, 0));
KdenliveSettings::setPreviewextension(profilestr.section(QLatin1Char(';'), 1, 1));
}
if (updateCapturePath) {
......@@ -941,11 +941,11 @@ void KdenliveSettingsDialog::loadTranscodeProfiles()
while (i.hasNext()) {
i.next();
QListWidgetItem *item = new QListWidgetItem(i.key());
QString data = i.value();
if (data.contains(QLatin1Char(';'))) {
item->setToolTip(data.section(QLatin1Char(';'), 1, 1));
QString profilestr = i.value();
if (profilestr.contains(QLatin1Char(';'))) {
item->setToolTip(profilestr.section(QLatin1Char(';'), 1, 1));
}
item->setData(Qt::UserRole, data);
item->setData(Qt::UserRole, profilestr);
m_configTranscode.profiles_list->addItem(item);
//item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
}
......@@ -975,16 +975,16 @@ void KdenliveSettingsDialog::slotAddTranscode()
return;
}
QListWidgetItem *item = new QListWidgetItem(m_configTranscode.profile_name->text());
QString data = m_configTranscode.profile_parameters->toPlainText();
data.append(" %1." + m_configTranscode.profile_extension->text());
data.append(';');
QString profilestr = m_configTranscode.profile_parameters->toPlainText();
profilestr.append(" %1." + m_configTranscode.profile_extension->text());
profilestr.append(';');
if (!m_configTranscode.profile_description->text().isEmpty()) {
data.append(m_configTranscode.profile_description->text());
profilestr.append(m_configTranscode.profile_description->text());
}
if (m_configTranscode.profile_audioonly->isChecked()) {
data.append(";audio");
profilestr.append(";audio");
}
item->setData(Qt::UserRole, data);
item->setData(Qt::UserRole, profilestr);
m_configTranscode.profiles_list->addItem(item);
m_configTranscode.profiles_list->setCurrentItem(item);
slotDialogModified();
......@@ -998,16 +998,16 @@ void KdenliveSettingsDialog::slotUpdateTranscodingProfile()
}
m_configTranscode.button_update->setEnabled(false);
item->setText(m_configTranscode.profile_name->text());
QString data = m_configTranscode.profile_parameters->toPlainText();
data.append(" %1." + m_configTranscode.profile_extension->text());
data.append(';');
QString profilestr = m_configTranscode.profile_parameters->toPlainText();
profilestr.append(" %1." + m_configTranscode.profile_extension->text());
profilestr.append(';');
if (!m_configTranscode.profile_description->text().isEmpty()) {
data.append(m_configTranscode.profile_description->text());
profilestr.append(m_configTranscode.profile_description->text());
}
if (m_configTranscode.profile_audioonly->isChecked()) {
data.append(QStringLiteral(";audio"));
profilestr.append(QStringLiteral(";audio"));
}
item->setData(Qt::UserRole, data);
item->setData(Qt::UserRole, profilestr);
slotDialogModified();
}
......@@ -1047,16 +1047,16 @@ void KdenliveSettingsDialog::slotSetTranscodeProfile()
return;
}
m_configTranscode.profile_name->setText(item->text());
QString data = item->data(Qt::UserRole).toString();
if (data.contains(QLatin1Char(';'))) {
m_configTranscode.profile_description->setText(data.section(QLatin1Char(';'), 1, 1));
if (data.section(QLatin1Char(';'), 2, 2) == QLatin1String("audio")) {
QString profilestr = item->data(Qt::UserRole).toString();
if (profilestr.contains(QLatin1Char(';'))) {
m_configTranscode.profile_description->setText(profilestr.section(QLatin1Char(';'), 1, 1));
if (profilestr.section(QLatin1Char(';'), 2, 2) == QLatin1String("audio")) {
m_configTranscode.profile_audioonly->setChecked(true);
}
data = data.section(QLatin1Char(';'), 0, 0).simplified();
profilestr = profilestr.section(QLatin1Char(';'), 0, 0).simplified();
}
m_configTranscode.profile_extension->setText(data.section(QLatin1Char('.'), -1));
m_configTranscode.profile_parameters->setPlainText(data.section(QLatin1Char(' '), 0, -2));
m_configTranscode.profile_extension->setText(profilestr.section(QLatin1Char('.'), -1));
m_configTranscode.profile_parameters->setPlainText(profilestr.section(QLatin1Char(' '), 0, -2));
m_configTranscode.profile_box->setEnabled(true);
}
......@@ -1207,9 +1207,9 @@ void KdenliveSettingsDialog::slotManageEncodingProfile()
if (act) {
type = act->data().toInt();
}
QPointer<EncodingProfilesDialog> d = new EncodingProfilesDialog(type);
d->exec();
delete d;
QPointer<EncodingProfilesDialog> dia = new EncodingProfilesDialog(type);
dia->exec();
delete dia;
loadEncodingProfiles();
}
......@@ -1289,11 +1289,11 @@ void KdenliveSettingsDialog::loadEncodingProfiles()
m_configProject.kcfg_preview_profile->setCurrentIndex(m_configProject.kcfg_preview_profile->findText(currentItem));
}
m_configProject.kcfg_preview_profile->blockSignals(false);
QString data = m_configProject.kcfg_preview_profile->itemData(m_configProject.kcfg_preview_profile->currentIndex()).toString();
if (data.isEmpty()) {
QString profilestr = m_configProject.kcfg_preview_profile->itemData(m_configProject.kcfg_preview_profile->currentIndex()).toString();
if (profilestr.isEmpty()) {
m_configProject.previewparams->clear();
} else {
m_configProject.previewparams->setPlainText(data.section(QLatin1Char(';'), 0, 0));
m_configProject.previewparams->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
}
// Load Proxy profiles
......@@ -1313,11 +1313,11 @@ void KdenliveSettingsDialog::loadEncodingProfiles()
m_configProject.kcfg_proxy_profile->setCurrentIndex(m_configProject.kcfg_proxy_profile->findText(currentItem));
}
m_configProject.kcfg_proxy_profile->blockSignals(false);
data = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile->currentIndex()).toString();
if (data.isEmpty()) {
profilestr = m_configProject.kcfg_proxy_profile->itemData(m_configProject.kcfg_proxy_profile->currentIndex()).toString();
if (profilestr.isEmpty()) {
m_configProject.proxyparams->clear();
} else {
m_configProject.proxyparams->setPlainText(data.section(QLatin1Char(';'), 0, 0));
m_configProject.proxyparams->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
}
}
......@@ -1328,11 +1328,11 @@ void KdenliveSettingsDialog::slotUpdateDecklinkProfile(int ix)
} else {
ix = m_configCapture.kcfg_decklink_profile->currentIndex();
}
QString data = m_configCapture.kcfg_decklink_profile->itemData(ix).toString();
if (data.isEmpty()) {
QString profilestr = m_configCapture.kcfg_decklink_profile->itemData(ix).toString();
if (profilestr.isEmpty()) {
return;
}
m_configCapture.decklink_parameters->setPlainText(data.section(QLatin1Char(';'), 0, 0));
m_configCapture.decklink_parameters->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
//
}
......@@ -1343,11 +1343,11 @@ void KdenliveSettingsDialog::slotUpdateV4lProfile(int ix)
} else {
ix = m_configCapture.kcfg_v4l_profile->currentIndex();
}
QString data = m_configCapture.kcfg_v4l_profile->itemData(ix).toString();
if (data.isEmpty()) {
QString profilestr = m_configCapture.kcfg_v4l_profile->itemData(ix).toString();
if (profilestr.isEmpty()) {
return;
}
m_configCapture.v4l_parameters->setPlainText(data.section(QLatin1Char(';'), 0, 0));
m_configCapture.v4l_parameters->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
//
}
......@@ -1358,11 +1358,11 @@ void KdenliveSettingsDialog::slotUpdateGrabProfile(int ix)
} else {
ix = m_configCapture.kcfg_grab_profile->currentIndex();
}
QString data = m_configCapture.kcfg_grab_profile->itemData(ix).toString();
if (data.isEmpty()) {
QString profilestr = m_configCapture.kcfg_grab_profile->itemData(ix).toString();
if (profilestr.isEmpty()) {
return;
}
m_configCapture.grab_parameters->setPlainText(data.section(QLatin1Char(';'), 0, 0));
m_configCapture.grab_parameters->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
//
}
......@@ -1373,11 +1373,11 @@ void KdenliveSettingsDialog::slotUpdateProxyProfile(int ix)
} else {
ix = m_configProject.kcfg_proxy_profile->currentIndex();
}
QString data = m_configProject.kcfg_proxy_profile->itemData(ix).toString();
if (data.isEmpty()) {
QString profilestr = m_configProject.kcfg_proxy_profile->itemData(ix).toString();
if (profilestr.isEmpty()) {
return;
}
m_configProject.proxyparams->setPlainText(data.section(QLatin1Char(';'), 0, 0));
m_configProject.proxyparams->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
}
void KdenliveSettingsDialog::slotUpdatePreviewProfile(int ix)
......@@ -1387,11 +1387,11 @@ void KdenliveSettingsDialog::slotUpdatePreviewProfile(int ix)
} else {
ix = m_configProject.kcfg_preview_profile->currentIndex();
}
QString data = m_configProject.kcfg_preview_profile->itemData(ix).toString();
if (data.isEmpty()) {
QString profilestr = m_configProject.kcfg_preview_profile->itemData(ix).toString();
if (profilestr.isEmpty()) {
return;
}
m_configProject.previewparams->setPlainText(data.section(QLatin1Char(';'), 0, 0));
m_configProject.previewparams->setPlainText(profilestr.section(QLatin1Char(';'), 0, 0));
}
void KdenliveSettingsDialog::slotEditVideo4LinuxProfile()
......
......@@ -34,6 +34,7 @@
#include <KMimeTypeTrader>
#include <KIO/DesktopExecParser>
#include <knotifications_version.h>
#include <kio_version.h>
#include <qglobal.h>
#include <qstring.h>
......@@ -295,10 +296,9 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, const
//m_view.splitter->setStretchFactor(0, 2);
m_view.out_file->setMode(KFile::File);
#if KXMLGUI_VERSION_MINOR > 32 || KXMLGUI_VERSION_MAJOR > 5
#if KIO_VERSION >= QT_VERSION_CHECK(5,33,0)
m_view.out_file->setAcceptMode(QFileDialog::AcceptSave);
#elif !defined(KIOWIDGETS_NO_DEPRECATED)
#elif !defined(KIOWIDGETS_DEPRECATED)
m_view.out_file->fileDialog()->setAcceptMode(QFileDialog::AcceptSave);
#endif
......@@ -1134,9 +1134,9 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
bool resizeProfile = false;
std::unique_ptr<ProfileModel>& profile = ProfileRepository::get()->getProfile(m_profile);
if (renderArgs.contains(QLatin1String("%dv_standard"))) {
QString std;
QString dvstd;
if (fmod((double)profile->frame_rate_num() / profile->frame_rate_den(), 30.01) > 27) {
std = QStringLiteral("ntsc");
dvstd = QStringLiteral("ntsc");
if (!(profile->frame_rate_num() == 30000 && profile->frame_rate_den() == 1001)) {
forcedfps = 30000.0 / 1001;
}
......@@ -1144,7 +1144,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
resizeProfile = true;
}
} else {
std = QStringLiteral("pal");
dvstd = QStringLiteral("pal");
if (!(profile->frame_rate_num() == 25 && profile->frame_rate_den() == 1)) {
forcedfps = 25;
}
......@@ -1154,9 +1154,9 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
}
if ((double) profile->display_aspect_num() / profile->display_aspect_den() > 1.5) {
std += QLatin1String("_wide");
dvstd += QLatin1String("_wide");
}
renderArgs.replace(QLatin1String("%dv_standard"), std);
renderArgs.replace(QLatin1String("%dv_standard"), dvstd);
}
// If there is an fps change, we need to use the producer consumer AND update the in/out points
......@@ -1953,20 +1953,20 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
QDomNodeList profilelist = doc.elementsByTagName(QStringLiteral("profile"));
for (int i = 0; i < profilelist.count(); ++i) {
QString category = i18nc("Category Name", "Custom");
QString extension;
QString ext;
QDomNode parent = profilelist.at(i).parentNode();
if (!parent.isNull()) {
QDomElement parentNode = parent.toElement();
if (parentNode.hasAttribute(QStringLiteral("name"))) {
category = parentNode.attribute(QStringLiteral("name"));
}
extension = parentNode.attribute(QStringLiteral("extension"));
ext = parentNode.attribute(QStringLiteral("extension"));
}
if (!profilelist.at(i).toElement().hasAttribute(QStringLiteral("category"))) {
profilelist.at(i).toElement().setAttribute(QStringLiteral("category"), category);
}
if (!extension.isEmpty()) {
profilelist.at(i).toElement().setAttribute(QStringLiteral("extension"), extension);
if (!ext.isEmpty()) {
profilelist.at(i).toElement().setAttribute(QStringLiteral("extension"), ext);
}
QDomNode n = profilelist.at(i).cloneNode();
newprofiles.appendChild(newdoc.importNode(n, true));
......@@ -2025,46 +2025,46 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
// Check if item with same name already exists and replace it,
// allowing to override default profiles
QTreeWidgetItem *item = nullptr;
QTreeWidgetItem *childitem = nullptr;
for (int j = 0; j < groupItem->childCount(); ++j) {
if (groupItem->child(j)->text(0) == profileName) {
item = groupItem->child(j);
childitem = groupItem->child(j);
break;
}
}
if (!item) {
item = new QTreeWidgetItem(QStringList(profileName));
if (!childitem) {
childitem = new QTreeWidgetItem(QStringList(profileName));
}
item->setData(0, GroupRole, groupName);
item->setData(0, ExtensionRole, extension);
item->setData(0, RenderRole, "avformat");
item->setData(0, StandardRole, standard);
item->setData(0, ParamsRole, params);
childitem->setData(0, GroupRole, groupName);
childitem->setData(0, ExtensionRole, extension);
childitem->setData(0, RenderRole, "avformat");
childitem->setData(0, StandardRole, standard);
childitem->setData(0, ParamsRole, params);
if (params.contains(QLatin1String("%quality"))) {
item->setData(0, BitratesRole, profile.attribute(QStringLiteral("qualities")).split(QLatin1Char(','), QString::SkipEmptyParts));
childitem->setData(0, BitratesRole, profile.attribute(QStringLiteral("qualities")).split(QLatin1Char(','), QString::SkipEmptyParts));
} else if (params.contains(QLatin1String("%bitrate"))) {
item->setData(0, BitratesRole, profile.attribute(QStringLiteral("bitrates")).split(QLatin1Char(','), QString::SkipEmptyParts));
childitem->setData(0, BitratesRole, profile.attribute(QStringLiteral("bitrates")).split(QLatin1Char(','), QString::SkipEmptyParts));
}
if (params.contains(QLatin1String("%audioquality"))) {
item->setData(0, AudioBitratesRole, profile.attribute(QStringLiteral("audioqualities")).split(QLatin1Char(','), QString::SkipEmptyParts));
childitem->setData(0, AudioBitratesRole, profile.attribute(QStringLiteral("audioqualities")).split(QLatin1Char(','), QString::SkipEmptyParts));
} else if (params.contains(QLatin1String("%audiobitrate"))) {
item->setData(0, AudioBitratesRole, profile.attribute(QStringLiteral("audiobitrates")).split(QLatin1Char(','), QString::SkipEmptyParts));
childitem->setData(0, AudioBitratesRole, profile.attribute(QStringLiteral("audiobitrates")).split(QLatin1Char(','), QString::SkipEmptyParts));
}
if (profile.hasAttribute(QStringLiteral("speeds"))) {
item->setData(0, SpeedsRole, profile.attribute(QStringLiteral("speeds")).split(QLatin1Char(';'), QString::SkipEmptyParts));
childitem->setData(0, SpeedsRole, profile.attribute(QStringLiteral("speeds")).split(QLatin1Char(';'), QString::SkipEmptyParts));
}
if (profile.hasAttribute(QStringLiteral("url"))) {
item->setData(0, ExtraRole, profile.attribute(QStringLiteral("url")));
childitem->setData(0, ExtraRole, profile.attribute(QStringLiteral("url")));
}
if (editable) {
item->setData(0, EditableRole, exportFile);
childitem->setData(0, EditableRole, exportFile);
if (exportFile.endsWith(QLatin1String("customprofiles.xml"))) {
item->setIcon(0, KoIconUtils::themedIcon(QStringLiteral("favorite")));
childitem->setIcon(0, KoIconUtils::themedIcon(QStringLiteral("favorite")));
} else {
item->setIcon(0, QIcon::fromTheme(QStringLiteral("applications-internet")));
childitem->setIcon(0, QIcon::fromTheme(QStringLiteral("applications-internet")));
}
}
groupItem->addChild(item);
groupItem->addChild(childitem);
node = doc.elementsByTagName(QStringLiteral("profile")).at(count);
count++;
}
......@@ -2171,9 +2171,9 @@ void RenderWidget::setRenderJob(const QString &dest, int progress)
} else {
QDateTime startTime = item->data(1, TimeRole).toDateTime();
qint64 elapsedTime = startTime.secsTo(QDateTime::currentDateTime());
quint32 remaining = elapsedTime * (100.0 - progress) / progress;
int days = remaining / 86400;
int remainingSecs = remaining % 86400;
qint64 remaining = elapsedTime * (100 - progress) / progress;
int days = static_cast<int>(remaining / 86400);
int remainingSecs = static_cast<int>(remaining % 86400);
QTime when = QTime ( 0, 0, 0, 0 ) ;
when = when.addSecs (remainingSecs) ;
QString est = (days > 0) ? i18np("%1 day ", "%1 days ", days) : QString();
......@@ -2200,10 +2200,10 @@ void RenderWidget::setRenderStatus(const QString &dest, int status, const QStrin
item->setStatus(FINISHEDJOB);
QDateTime startTime = item->data(1, TimeRole).toDateTime();
qint64 elapsedTime = startTime.secsTo(QDateTime::currentDateTime());
int days = elapsedTime / 86400;
elapsedTime -= (days * 86400);
int days = static_cast<int>(elapsedTime / 86400);
int secs = static_cast<int>(elapsedTime % 86400);
QTime when = QTime ( 0, 0, 0, 0 ) ;
when = when.addSecs (elapsedTime) ;
when = when.addSecs (secs) ;
QString est = (days > 0) ? i18np("%1 day ", "%1 days ", days) : QString();
est.append(when.toString(QStringLiteral("hh:mm:ss")));
QString t = i18n("Rendering finished in %1", est);
......
......@@ -48,10 +48,10 @@ TitleTemplateDialog::TitleTemplateDialog(const QString &folder, QWidget *parent)
const QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
for (const QString &folderpath : titleTemplates) {
QDir folder(folderpath);
const QStringList filesnames = folder.entryList(filter, QDir::Files);
QDir sysdir(folderpath);
const QStringList filesnames = sysdir.entryList(filter, QDir::Files);
for (const QString &fname : filesnames) {
m_view.template_list->comboBox()->addItem(fname, folder.absoluteFilePath(fname));
m_view.template_list->comboBox()->addItem(fname, sysdir.absoluteFilePath(fname));
}
}
......
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