From c69ac32e6d351f7ceb968fd000eb67ea5a377db3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 3 Mar 2009 15:47:10 +0000 Subject: [PATCH] More krazy code fixes svn path=/branches/KDE4/; revision=3092 --- plugins/sampleplugin/sampleplugin.h | 3 ++- src/clipmanager.cpp | 10 +++++----- src/clipproperties.cpp | 12 ++++++------ src/docclipbase.cpp | 6 +++--- src/effectstackview.cpp | 2 +- src/guide.cpp | 2 +- src/initeffects.cpp | 16 ++++++++-------- src/initeffects.h | 2 +- src/jogshuttle.cpp | 4 ++-- src/kdenlivesettings.kcfg | 3 +-- src/kdenlivesettingsdialog.cpp | 5 +++-- src/kdenliveui.rc | 2 +- src/kthumb.cpp | 2 +- src/mainwindow.cpp | 4 ++-- src/monitormanager.h | 2 +- src/projectlist.cpp | 14 +++++++------- src/renderer.cpp | 2 +- src/renderer.h | 2 +- src/renderwidget.cpp | 4 ++-- src/trackview.cpp | 2 +- 20 files changed, 50 insertions(+), 49 deletions(-) diff --git a/plugins/sampleplugin/sampleplugin.h b/plugins/sampleplugin/sampleplugin.h index c25d8ac4..9238d707 100644 --- a/plugins/sampleplugin/sampleplugin.h +++ b/plugins/sampleplugin/sampleplugin.h @@ -38,4 +38,5 @@ public: }; -#endif \ No newline at end of file +#endif + diff --git a/src/clipmanager.cpp b/src/clipmanager.cpp index d701639c..c310f79d 100644 --- a/src/clipmanager.cpp +++ b/src/clipmanager.cpp @@ -57,7 +57,7 @@ void ClipManager::checkAudioThumbs() { if (m_generatingAudioId.isEmpty()) startAudioThumbsGeneration(); } else { m_audioThumbsQueue.clear(); - m_generatingAudioId = QString(); + m_generatingAudioId.clear(); } } @@ -72,7 +72,7 @@ void ClipManager::askForAudioThumb(const QString &id) { void ClipManager::startAudioThumbsGeneration() { if (!KdenliveSettings::audiothumbnails()) { m_audioThumbsQueue.clear(); - m_generatingAudioId = QString(); + m_generatingAudioId.clear(); return; } if (!m_audioThumbsQueue.isEmpty()) { @@ -81,14 +81,14 @@ void ClipManager::startAudioThumbsGeneration() { if (!clip || !clip->slotGetAudioThumbs()) endAudioThumbsGeneration(m_generatingAudioId); } else { - m_generatingAudioId = QString(); + m_generatingAudioId.clear(); } } void ClipManager::endAudioThumbsGeneration(const QString &requestedId) { if (!KdenliveSettings::audiothumbnails()) { m_audioThumbsQueue.clear(); - m_generatingAudioId = QString(); + m_generatingAudioId.clear(); return; } if (!m_audioThumbsQueue.isEmpty()) { @@ -96,7 +96,7 @@ void ClipManager::endAudioThumbsGeneration(const QString &requestedId) { startAudioThumbsGeneration(); } } else { - m_generatingAudioId = QString(); + m_generatingAudioId.clear(); } } diff --git a/src/clipproperties.cpp b/src/clipproperties.cpp index 0d811028..825ca86e 100644 --- a/src/clipproperties.cpp +++ b/src/clipproperties.cpp @@ -314,7 +314,7 @@ QMap ClipProperties::properties() { m_clipNeedsRefresh = true; } } else if (old_props.contains("force_aspect_ratio")) { - props["force_aspect_ratio"] = QString(); + props["force_aspect_ratio"].clear(); m_clipNeedsRefresh = true; } @@ -324,7 +324,7 @@ QMap ClipProperties::properties() { props["threads"] = QString::number(threads); } } else if (old_props.contains("threads")) { - props["threads"] = QString(); + props["threads"].clear(); } int vindex = m_view.clip_vindex->value(); @@ -333,7 +333,7 @@ QMap ClipProperties::properties() { props["video_index"] = QString::number(vindex); } } else if (old_props.contains("video_index")) { - props["video_index"] = QString(); + props["video_index"].clear(); } int aindex = m_view.clip_aindex->value(); @@ -342,7 +342,7 @@ QMap ClipProperties::properties() { props["audio_index"] = QString::number(aindex); } } else if (old_props.contains("audio_index")) { - props["audio_index"] = QString(); + props["audio_index"].clear(); } if (t == COLOR) { @@ -417,8 +417,8 @@ QMap ClipProperties::properties() { props["luma_file"] = lumaFile; } } else { - if (old_props.value("luma_file") != QString()) { - props["luma_file"] = QString(); + if (!old_props.value("luma_file").isEmpty()) { + props["luma_file"].clear(); } } diff --git a/src/docclipbase.cpp b/src/docclipbase.cpp index 321a641d..ade305e4 100644 --- a/src/docclipbase.cpp +++ b/src/docclipbase.cpp @@ -378,7 +378,7 @@ QString DocClipBase::markerComment(GenTime t) { return (*itt).comment(); ++itt; } - return QString::null; + return QString(); } void DocClipBase::deleteProducers() { @@ -504,7 +504,7 @@ void DocClipBase::slotRefreshProducer() { char *tmp = (char *) qstrdup(resource.toUtf8().data()); filter->set("luma.resource", tmp); delete[] tmp; - if (getProperty("softness") != QString()) { + if (!getProperty("softness").isEmpty()) { int soft = getProperty("softness").toInt(); filter->set("luma.softness", (double) soft / 100.0); } @@ -517,7 +517,7 @@ void DocClipBase::slotRefreshProducer() { char *tmp = (char *) qstrdup(resource.toUtf8().data()); filter->set("luma.resource", tmp); delete[] tmp; - if (getProperty("softness") != QString()) { + if (!getProperty("softness").isEmpty()) { int soft = getProperty("softness").toInt(); filter->set("luma.softness", (double) soft / 100.0); } diff --git a/src/effectstackview.cpp b/src/effectstackview.cpp index 1b768914..87147100 100644 --- a/src/effectstackview.cpp +++ b/src/effectstackview.cpp @@ -165,7 +165,7 @@ void EffectStackView::setupListView(int ix) { if (!namenode.isNull()) { // Issue 238: Add icons for effect type in effectstack. // Logic more or less copied from initeffects.cpp - QString type = d.attribute("type", QString::null); + QString type = d.attribute("type", QString()); if ("audio" == type) { item = new QListWidgetItem(audioIcon, i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist); } else if ("custom" == type) { diff --git a/src/guide.cpp b/src/guide.cpp index f1d029d3..37be746d 100644 --- a/src/guide.cpp +++ b/src/guide.cpp @@ -58,7 +58,7 @@ CommentedTime Guide::info() const { void Guide::updateGuide(const GenTime newPos, const QString &comment) { m_position = newPos; setPos(m_position.frames(m_fps), 0); - if (comment != QString()) { + if (!comment.isEmpty()) { m_label = comment; setToolTip(m_label); const QFontMetrics metric = m_view->fontMetrics(); diff --git a/src/initeffects.cpp b/src/initeffects.cpp index 9d86caea..adb65e27 100644 --- a/src/initeffects.cpp +++ b/src/initeffects.cpp @@ -256,24 +256,24 @@ void initEffects::parseEffectFile(EffectsList *customEffectList, EffectsList *au } QString groupName; if (doc.elementsByTagName("effectgroup").item(0).toElement().tagName() == "effectgroup") { - groupName = documentElement.attribute("name", QString::null); + groupName = documentElement.attribute("name", QString()); } int i = 0; while (!effects.item(i).isNull()) { documentElement = effects.item(i).toElement(); - QString tag = documentElement.attribute("tag", QString::null); + QString tag = documentElement.attribute("tag", QString()); bool ladspaOk = true; if (tag == "ladspa") { - QString library = documentElement.attribute("library", QString::null); + QString library = documentElement.attribute("library", QString()); if (KStandardDirs::locate("ladspa_plugin", library).isEmpty()) ladspaOk = false; } // Parse effect file if ((filtersList.contains(tag) || producersList.contains(tag)) && ladspaOk) { bool isAudioEffect = false; - QString type = documentElement.attribute("type", QString::null); + QString type = documentElement.attribute("type", QString()); if (type == "audio") audioEffectList->append(documentElement); else if (type == "custom") customEffectList->append(documentElement); else videoEffectList->append(documentElement); @@ -297,10 +297,10 @@ void initEffects::parseEffectFile(EffectsList *customEffectList, EffectsList *au QDomNode propsnode = documentElement.elementsByTagName("properties").item(0); if (!propsnode.isNull()) { QDomElement propselement = propsnode.toElement(); - id = propselement.attribute("id", QString::null); - effectTag = propselement.attribute("tag", QString::null); - if (propselement.attribute("type", QString::null) == "audio") type = AUDIOEFFECT; - else if (propselement.attribute("type", QString::null) == "custom") type = CUSTOMEFFECT; + id = propselement.attribute("id", QString()); + effectTag = propselement.attribute("tag", QString()); + if (propselement.attribute("type", QString()) == "audio") type = AUDIOEFFECT; + else if (propselement.attribute("type", QString()) == "custom") type = CUSTOMEFFECT; else type = VIDEOEFFECT; } diff --git a/src/initeffects.h b/src/initeffects.h index 3da9dd54..f62898cd 100644 --- a/src/initeffects.h +++ b/src/initeffects.h @@ -42,7 +42,7 @@ private : }; class initEffects : public QObject { - + Q_OBJECT public: initEffects(); ~initEffects(); diff --git a/src/jogshuttle.cpp b/src/jogshuttle.cpp index f53f4916..208706cc 100644 --- a/src/jogshuttle.cpp +++ b/src/jogshuttle.cpp @@ -58,7 +58,7 @@ #include #include - +#include #include #include @@ -87,7 +87,7 @@ bool ShuttleThread::isWorking() { void ShuttleThread::run() { kDebug() << "------- STARTING SHUTTLE: " << m_device; - const int fd = open((char *) m_device.toUtf8().data(), O_RDONLY); + const int fd = KDE_open((char *) m_device.toUtf8().data(), O_RDONLY); if (fd < 0) { fprintf(stderr, "Can't open Jog Shuttle FILE DESCRIPTOR\n"); return;; diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg index abe9cacb..503a9a90 100644 --- a/src/kdenlivesettings.kcfg +++ b/src/kdenlivesettings.kcfg @@ -1,6 +1,5 @@ - + diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index 73dc108e..285cd4f4 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -217,7 +218,7 @@ void KdenliveSettingsDialog::initDevices() { // Fill the list of audio playback devices m_configSdl.kcfg_audio_device->addItem(i18n("Default"), QString()); m_configCapture.kcfg_rmd_alsa_device->addItem(i18n("Default"), QString()); - if (KStandardDirs::findExe("aplay") != QString::null) { + if (!KStandardDirs::findExe("aplay").isEmpty()) { m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel); m_readProcess.setProgram("aplay", QStringList() << "-l"); connect(&m_readProcess, SIGNAL(readyReadStandardOutput()) , this, SLOT(slotReadAudioDevices())); @@ -338,7 +339,7 @@ void KdenliveSettingsDialog::slotCheckShuttle(int state) { kDebug() << "/// CHECKING OFR: " << filename; char name[256] = "unknown"; - fd = ::open((char *) filename.toUtf8().data(), O_RDONLY); + fd = KDE_open((char *) filename.toUtf8().data(), O_RDONLY); if (fd >= 0 && ioctl(fd, EVIOCGNAME(sizeof(name)), name) >= 0) { m_configShuttle.shuttledevicelist->addItem(name, filename); } diff --git a/src/kdenliveui.rc b/src/kdenliveui.rc index 20ff76c6..7c6e04b9 100644 --- a/src/kdenliveui.rc +++ b/src/kdenliveui.rc @@ -120,4 +120,4 @@ - \ No newline at end of file + diff --git a/src/kthumb.cpp b/src/kthumb.cpp index a836be14..f5963c1a 100644 --- a/src/kthumb.cpp +++ b/src/kthumb.cpp @@ -96,7 +96,7 @@ void MyThread::run() { int m_samples = mlt_sample_calculator(m_framesPerSecond, m_frequency, mlt_frame_get_position(mlt_frame->get_frame())); mlt_audio_format m_audioFormat = mlt_audio_pcm; - int16_t* m_pcm = mlt_frame->get_audio(m_audioFormat, m_frequency, m_channels, m_samples); + qint16* m_pcm = mlt_frame->get_audio(m_audioFormat, m_frequency, m_channels, m_samples); for (int c = 0;c < m_channels;c++) { QByteArray m_array; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 431584d6..96ba5066 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2157,7 +2157,7 @@ void MainWindow::slotFind() { if (!m_activeDocument || !m_activeTimeline) return; m_projectSearch->setEnabled(false); m_findActivated = true; - m_findString = QString(); + m_findString.clear(); m_activeTimeline->projectView()->initSearchStrings(); statusBar()->showMessage(i18n("Starting -- find text as you type")); m_findTimer.start(5000); @@ -2186,7 +2186,7 @@ void MainWindow::findAhead() { void MainWindow::findTimeout() { m_projectSearchNext->setEnabled(false); m_findActivated = false; - m_findString = QString(); + m_findString.clear(); statusBar()->showMessage(i18n("Find stopped"), 3000); if (m_activeTimeline) m_activeTimeline->projectView()->clearSearchStrings(); m_projectSearch->setEnabled(true); diff --git a/src/monitormanager.h b/src/monitormanager.h index 9029407c..21091084 100644 --- a/src/monitormanager.h +++ b/src/monitormanager.h @@ -38,7 +38,7 @@ public: void stopActiveMonitor(); public slots: - void activateMonitor(QString name = QString::null); + void activateMonitor(QString name = QString()); void slotPlay(); void slotPlayZone(); void slotLoopZone(); diff --git a/src/projectlist.cpp b/src/projectlist.cpp index b07f8a62..e53760dd 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -541,7 +541,7 @@ void ProjectList::slotAddClip(KUrl givenUrl, QString group) { } else list.append(givenUrl); if (list.isEmpty()) return; - QString groupId = QString(); + QString groupId; if (group.isEmpty()) { ProjectItem *item = static_cast (listView->currentItem()); if (item && !item->isGroup()) { @@ -582,8 +582,8 @@ void ProjectList::slotAddColorClip() { QString color = dia_ui->clip_color->color().name(); color = color.replace(0, 1, "0x") + "ff"; - QString group = QString(); - QString groupId = QString(); + QString group; + QString groupId; ProjectItem *item = static_cast (listView->currentItem()); if (item && !item->isGroup()) { while (item->parent()) { @@ -609,8 +609,8 @@ void ProjectList::slotAddSlideshowClip() { if (dia->exec() == QDialog::Accepted) { - QString group = QString(); - QString groupId = QString(); + QString group; + QString groupId; ProjectItem *item = static_cast (listView->currentItem()); if (item && !item->isGroup()) { while (item->parent()) { @@ -629,8 +629,8 @@ void ProjectList::slotAddSlideshowClip() { } void ProjectList::slotAddTitleClip() { - QString group = QString(); - QString groupId = QString(); + QString group; + QString groupId; ProjectItem *item = static_cast (listView->currentItem()); if (item && !item->isGroup()) { while (item->parent()) { diff --git a/src/renderer.cpp b/src/renderer.cpp index 503f02ff..97fcd3c1 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -467,7 +467,7 @@ void Render::getFileProperties(const QDomElement &xml, const QString &clipId, bo QMap < QString, QString > filePropertyMap; QMap < QString, QString > metadataPropertyMap; - KUrl url = KUrl(xml.attribute("resource", QString::null)); + KUrl url = KUrl(xml.attribute("resource", QString())); Mlt::Producer *producer = NULL; if (xml.attribute("type").toInt() == TEXT && !QFile::exists(url.path())) { emit replyGetFileProperties(clipId, producer, filePropertyMap, metadataPropertyMap, replaceProducer); diff --git a/src/renderer.h b/src/renderer.h index eafd05a0..3f3fbe0d 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -31,7 +31,7 @@ /**Render encapsulates the client side of the interface to a renderer. From Kdenlive's point of view, you treat the Render object as the renderer, and simply use it as if it was local. Calls are asyncrhonous - -you send a call out, and then recieve the return value through the +you send a call out, and then receive the return value through the relevant signal that get's emitted once the call completes. *@author Jason Wood */ diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index 8e0c07bf..461bd71b 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -1022,8 +1022,8 @@ void RenderWidget::parseFile(QString exportFile, bool editable) { } } groupName = documentElement.attribute("name", i18n("Custom")); - extension = documentElement.attribute("extension", QString::null); - renderer = documentElement.attribute("renderer", QString::null); + extension = documentElement.attribute("extension", QString()); + renderer = documentElement.attribute("renderer", QString()); QList list = m_view.format_list->findItems(groupName, Qt::MatchExactly); bool exists = false; for (int j = 0; j < list.count(); j++) { diff --git a/src/trackview.cpp b/src/trackview.cpp index e160ea79..c1f66bad 100644 --- a/src/trackview.cpp +++ b/src/trackview.cpp @@ -121,7 +121,7 @@ void TrackView::setDuration(int dur) { void TrackView::parseDocument(QDomDocument doc) { int cursorPos = 0; - m_documentErrors = QString(); + m_documentErrors.clear(); // kDebug() << "//// DOCUMENT: " << doc.toString(); /*QDomNode props = doc.elementsByTagName("properties").item(0); if (!props.isNull()) { -- 2.39.2