Skip to content

Commit 44812b8

Browse files
committed
rename ApplicationHelpers to LiveCoding
1 parent 83b1f2f commit 44812b8

6 files changed

+18
-354
lines changed

cpp-qt-live-coding.pro.user

-336
This file was deleted.

lib/LiveCodingPanel.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Item {
1616

1717
function reload() {
1818
loader.source = ""
19-
ApplicationHelpers.clearQmlComponentCache()
19+
LiveCoding.clearQmlComponentCache()
2020
loader.source = fileDialog.file
2121
}
2222

2323
function openWithSystemEditor() {
24-
ApplicationHelpers.openUrlWithDefaultApplication(fileDialog.file)
24+
LiveCoding.openUrlWithDefaultApplication(fileDialog.file)
2525
}
2626

2727
function unload() {

lib/cpp_qt_live_coding_plugin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "cpp_qt_live_coding_plugin.h"
2-
#include "applicationhelpers.h"
2+
#include "livecoding.h"
33
#include "filewatcher.h"
44
#include "projectbrowser.h"
55

@@ -27,7 +27,7 @@ void CppQtLiveCodingPlugin::registerTypes(const char *uri)
2727
// @uri com.machinekoder.live
2828
qmlRegisterType<FileWatcher>(uri, 1, 0, "FileWatcher");
2929
qmlRegisterType<ProjectBrowser>(uri, 1, 0, "ProjectBrowser");
30-
qmlRegisterSingletonType<ApplicationHelpers>(uri, 1, 0, "ApplicationHelpers", ApplicationHelpers::qmlSingletonProvider);
30+
qmlRegisterSingletonType<LiveCoding>(uri, 1, 0, "LiveCoding", LiveCoding::qmlSingletonProvider);
3131

3232
const QString filesLocation = fileLocation();
3333
for (int i = 0; i < int(sizeof(qmldir)/sizeof(qmldir[0])); i++) {

lib/lib.pro

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ uri = com.machinekoder.live
99
# Input
1010
SOURCES += \
1111
filewatcher.cpp \
12-
applicationhelpers.cpp \
1312
projectbrowser.cpp \
1413
cpp_qt_live_coding_plugin.cpp \
15-
livewindow.cpp
14+
livewindow.cpp \
15+
livecoding.cpp
1616

1717
HEADERS += \
1818
filewatcher.h \
19-
applicationhelpers.h \
2019
projectbrowser.h \
2120
cpp_qt_live_coding_plugin.h \
22-
livewindow.h
21+
livewindow.h \
22+
livecoding.h
2323

2424
DISTFILES = qmldir
2525

lib/applicationhelpers.cpp renamed to lib/livecoding.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
#include "applicationhelpers.h"
1+
#include "livecoding.h"
22
#include <QDesktopServices>
33
#include <QLocale>
44
#include <QProcess>
55
#include <QSettings>
66
#include <QCoreApplication>
77

8-
ApplicationHelpers::ApplicationHelpers(QQmlEngine *engine, QObject *parent)
8+
LiveCoding::LiveCoding(QQmlEngine *engine, QObject *parent)
99
: QObject(parent)
1010
, m_engine(engine)
1111
{
1212

1313
}
1414

15-
bool ApplicationHelpers::openUrlWithDefaultApplication(const QUrl &url) const
15+
bool LiveCoding::openUrlWithDefaultApplication(const QUrl &url) const
1616
{
1717
return QDesktopServices::openUrl(url);
1818
}
1919

20-
void ApplicationHelpers::clearQmlComponentCache() const
20+
void LiveCoding::clearQmlComponentCache() const
2121
{
2222
m_engine->clearComponentCache();
2323
}
2424

25-
QString ApplicationHelpers::currentLanguage() const
25+
QString LiveCoding::currentLanguage() const
2626
{
2727
const auto languages = QLocale().uiLanguages();
2828
return languages.first();
2929
}
3030

31-
void ApplicationHelpers::setLanguage(const QString &language)
31+
void LiveCoding::setLanguage(const QString &language)
3232
{
3333
QSettings settings;
3434
settings.setValue("language", language);
3535
settings.sync();
3636
}
3737

38-
void ApplicationHelpers::restartApplication()
38+
void LiveCoding::restartApplication()
3939
{
4040
qApp->quit();
4141
QProcess::startDetached(qApp->arguments()[0], qApp->arguments());

lib/applicationhelpers.h renamed to lib/livecoding.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
#include <QObject>
55
#include <QQmlEngine>
66

7-
class ApplicationHelpers : public QObject
7+
class LiveCoding : public QObject
88
{
99
Q_OBJECT
1010

1111
Q_PROPERTY(QString currentLanguage READ currentLanguage CONSTANT)
1212

1313
public:
14-
explicit ApplicationHelpers(QQmlEngine *engine, QObject *parent = nullptr);
14+
explicit LiveCoding(QQmlEngine *engine, QObject *parent = nullptr);
1515

1616
static QObject *qmlSingletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
1717
{
1818
Q_UNUSED(engine)
1919
Q_UNUSED(scriptEngine)
2020

21-
return new ApplicationHelpers(engine);
21+
return new LiveCoding(engine);
2222
}
2323

2424
/**

0 commit comments

Comments
 (0)