Commit c98ef2b8 authored by Sandro Andrade's avatar Sandro Andrade
Browse files

Fix Krazy errors

parent 1f906ef4
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......@@ -26,12 +26,12 @@
#include <KI18n/KLocalizedString>
#include <QtCore/QDir>
#include <QtCore/QDateTime>
#include <QtCore/QJsonDocument>
#include <QtCore/QStandardPaths>
#include <QDir>
#include <QDateTime>
#include <QJsonDocument>
#include <QStandardPaths>
#include <QtQml>
#include <QtQml> // krazy:exclude=includes
#include <drumstick/alsaevent.h>
......@@ -121,7 +121,7 @@ bool ExerciseController::configureExercises()
{
m_errorString.clear();
QDir exercisesDir = QStandardPaths::locate(QStandardPaths::AppDataLocation, "exercises", QStandardPaths::LocateDirectory);
foreach (QString exercise, exercisesDir.entryList(QDir::Files)) {
foreach (const QString &exercise, exercisesDir.entryList(QDir::Files)) {
QFile exerciseFile(exercisesDir.absoluteFilePath(exercise));
if (!exerciseFile.open(QIODevice::ReadOnly)) {
m_errorString = i18n("Couldn't open exercise file \"%1\".", exercisesDir.absoluteFilePath(exercise));
......@@ -175,4 +175,5 @@ QJsonArray ExerciseController::mergeExercises(QJsonArray exercises, QJsonArray n
}
}
return exercises;
}
\ No newline at end of file
}
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......@@ -23,9 +23,9 @@
#ifndef EXERCISECONTROLLER_H
#define EXERCISECONTROLLER_H
#include <QtCore/QObject>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonObject>
#include <QObject>
#include <QJsonArray>
#include <QJsonObject>
class MidiSequencer;
......@@ -35,7 +35,7 @@ class ExerciseController : public QObject
Q_ENUMS(PlayMode)
public:
ExerciseController(MidiSequencer *midiSequencer = 0);
explicit ExerciseController(MidiSequencer *midiSequencer = 0);
virtual ~ExerciseController();
enum PlayMode {
......
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......@@ -24,7 +24,7 @@
#include <KCoreAddons/KAboutData>
#include <QtCore/QCommandLineParser>
#include <QCommandLineParser>
Q_DECLARE_LOGGING_CATEGORY(MINUET)
Q_LOGGING_CATEGORY(MINUET, "minuet")
......@@ -39,7 +39,7 @@ int main(int argc, char **argv)
QStringLiteral("0.1"),
i18n("A KDE application for music education"),
KAboutLicense::GPL,
i18n("(c) 2015, Sandro S. Andrade <sandroandrade@kde.org>"));
i18n("(c) 2016, Sandro S. Andrade (sandroandrade@kde.org)"));
aboutData.addAuthor(i18n("Sandro S. Andrade"),i18n("Author"), QStringLiteral("sandroandrade@kde.org"));
application.setWindowIcon(QIcon::fromTheme("minuet"));
......
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......@@ -26,11 +26,11 @@
#include "midisequenceroutputthread.h"
#include <KI18n/KLocalizedString>
#include <KWidgetsAddons/KMessageBox>
#include <QtMath>
#include <QtCore/QLoggingCategory>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QApplication>
#include <QLoggingCategory>
#include <QApplication>
Q_DECLARE_LOGGING_CATEGORY(MINUET)
......@@ -48,7 +48,7 @@ MidiSequencer::MidiSequencer(QObject *parent) :
try {
m_client->open();
} catch (const drumstick::SequencerError &err) {
QMessageBox::critical(qobject_cast<QWidget*>(this->parent()), i18n("Minuet startup"), i18n("Fatal error from the ALSA sequencer: \"%1\". "
KMessageBox::error(qobject_cast<QWidget*>(this->parent()), i18n("Minuet startup"), i18n("Fatal error from the ALSA sequencer: \"%1\". "
"This usually happens when the kernel doesn't have ALSA support, "
"or the device node (/dev/snd/seq) doesn't exists, "
"or the kernel module (snd_seq) is not loaded. "
......
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......@@ -25,7 +25,7 @@
#include "song.h"
#include <QtCore/QObject>
#include <QObject>
#include <drumstick/alsaqueue.h>
......@@ -43,7 +43,7 @@ class MidiSequencer : public QObject
Q_OBJECT
public:
MidiSequencer(QObject *parent = 0);
explicit MidiSequencer(QObject *parent = 0);
virtual ~MidiSequencer();
void subscribeTo(const QString &portName);
......@@ -116,4 +116,5 @@ private:
QString m_currentSubscribedPort;
};
#endif // MIDISEQUENCER_H
\ No newline at end of file
#endif // MIDISEQUENCER_H
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......@@ -27,17 +27,18 @@
#include "exercisecontroller.h"
#include <KXmlGui/KActionCollection>
#include <KWidgetsAddons/KMessageBox>
#include <KConfigWidgets/KConfigDialog>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlContext>
#include <QQmlEngine>
#include <QQmlContext>
#include <QtCore/QTimer>
#include <QTimer>
#include <QPointer>
#include <QtQuick/QQuickView>
#include <QQuickView>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QMessageBox>
#include <QToolBar>
Minuet::Minuet() :
KXmlGuiWindow(),
......@@ -47,7 +48,7 @@ Minuet::Minuet() :
m_initialGroup(KSharedConfig::openConfig(), "version")
{
if (!m_exerciseController->configureExercises())
QMessageBox::critical(0, i18n("Minuet startup"),
KMessageBox::error(0, i18n("Minuet startup"),
i18n("There was an error when parsing exercises JSON files: \"%1\".", m_exerciseController->errorString()));
m_quickView->engine()->rootContext()->setContextProperty("exerciseCategories", m_exerciseController->exercises()["exercises"].toArray());
......@@ -98,7 +99,7 @@ void Minuet::startTimidity()
qCDebug(MINUET) << "TiMidity already running!";
}
if (!error.isEmpty())
QMessageBox::critical(this, i18n("Minuet startup"), i18n("There was an error when starting TiMidity: \"%1\". Is another application using the audio system? Also, please check Minuet settings!", error));
KMessageBox::error(this, i18n("Minuet startup"), i18n("There was an error when starting TiMidity: \"%1\". Is another application using the audio system? Also, please check Minuet settings!", error));
}
bool Minuet::waitForTimidityOutputPorts(int msecs)
......@@ -138,7 +139,7 @@ bool Minuet::queryClose()
void Minuet::fileOpen()
{
QString fileName = QFileDialog::getOpenFileName(this, i18n("Open File"));
QString fileName = QFileDialog::getOpenFileName(this, i18n("Open File")); // krazy:exclude=qclasses
if (!fileName.isEmpty())
m_midiSequencer->openFile(fileName);
}
......@@ -157,7 +158,7 @@ void Minuet::settingsConfigure()
if (KConfigDialog::showDialog("settings"))
return;
KConfigDialog *dialog = new KConfigDialog(this, "settings", MinuetSettings::self());
QPointer<KConfigDialog> dialog = new KConfigDialog(this, "settings", MinuetSettings::self());
QWidget *generalSettingsDialog = new QWidget;
m_settingsGeneral.setupUi(generalSettingsDialog);
QWidget *midiSettingsDialog = new QWidget;
......@@ -165,9 +166,10 @@ void Minuet::settingsConfigure()
m_settingsMidi.kcfg_midiOutputPort->setVisible(false);
m_settingsMidi.cboMidiOutputPort->insertItems(0, m_midiSequencer->availableOutputPorts());
m_settingsMidi.cboMidiOutputPort->setCurrentIndex(m_settingsMidi.cboMidiOutputPort->findText(MinuetSettings::midiOutputPort()));
dialog->addPage(generalSettingsDialog, i18n("General"), QStringLiteral("fileview-preview"));
dialog->addPage(generalSettingsDialog, i18nc("The general config group", "General"), QStringLiteral("fileview-preview"));
dialog->addPage(midiSettingsDialog, i18n("MIDI"), QStringLiteral("media-playback-start"));
dialog->setAttribute(Qt::WA_DeleteOnClose);
if (dialog->exec() == QDialog::Accepted)
subscribeToMidiOutputPort();
delete dialog;
}
/****************************************************************************
**
** Copyright (C) 2015 by Sandro S. Andrade <sandroandrade@kde.org>
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
......@@ -30,7 +30,7 @@
#include <KCoreAddons/KProcess>
#include <KXmlGui/KXmlGuiWindow>
#include <QtCore/QLoggingCategory>
#include <QLoggingCategory>
class QQuickView;
......@@ -94,4 +94,5 @@ private:
KProcess m_timidityProcess;
};
#endif // MINUET_H
\ No newline at end of file
#endif // MINUET_H
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
import QtQuick.Controls 1.3
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.0
import QtQuick.Controls.Styles 1.1
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.1
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
Item {
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
import org.kde.plasma.core 2.0 as PlasmaCore
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
Item {
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
import QtQuick.Controls 1.3
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
Rectangle {
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
Item {
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
Rectangle {
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
import QtQuick 2.4
Rectangle {
......
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