Skip to content

Commit

Permalink
Removed QML system paths since integrated in new Qt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
FalsinSoft committed Jan 4, 2024
1 parent 0feff91 commit e1a1649
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 125 deletions.
41 changes: 0 additions & 41 deletions QtAndroidTools/QAndroidSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ QAndroidSystem::QAndroidSystem(QObject *parent) : QObject(parent),
QNativeInterface::QAndroidApplication::context())
{
m_pInstance = this;
loadStandardPaths();
}

QAndroidSystem* QAndroidSystem::create(QQmlEngine *engine, QJSEngine *scriptEngine)
Expand Down Expand Up @@ -74,43 +73,3 @@ int QAndroidSystem::ptToPx(float pt)
}
return -1;
}

const QString& QAndroidSystem::getDataLocation() const
{
return m_standardPaths.dataLocation;
}

const QString& QAndroidSystem::getConfigLocation() const
{
return m_standardPaths.configLocation;
}

const QString& QAndroidSystem::getDownloadLocation() const
{
return m_standardPaths.downloadLocation;
}

const QString& QAndroidSystem::getMusicLocation() const
{
return m_standardPaths.musicLocation;
}

const QString& QAndroidSystem::getMoviesLocation() const
{
return m_standardPaths.moviesLocation;
}

const QString& QAndroidSystem::getPicturesLocation() const
{
return m_standardPaths.picturesLocation;
}

void QAndroidSystem::loadStandardPaths()
{
m_standardPaths.dataLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
m_standardPaths.configLocation = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
m_standardPaths.downloadLocation = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
m_standardPaths.musicLocation = QStandardPaths::writableLocation(QStandardPaths::MusicLocation);
m_standardPaths.moviesLocation = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
m_standardPaths.picturesLocation = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
}
25 changes: 0 additions & 25 deletions QtAndroidTools/QAndroidSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,11 @@
*/
#pragma once

#include <QStandardPaths>
#include <QJniObject>
#include <QQmlEngine>

class QAndroidSystem : public QObject
{
Q_PROPERTY(QString dataLocation READ getDataLocation CONSTANT)
Q_PROPERTY(QString configLocation READ getConfigLocation CONSTANT)
Q_PROPERTY(QString downloadLocation READ getDownloadLocation CONSTANT)
Q_PROPERTY(QString musicLocation READ getMusicLocation CONSTANT)
Q_PROPERTY(QString moviesLocation READ getMoviesLocation CONSTANT)
Q_PROPERTY(QString picturesLocation READ getPicturesLocation CONSTANT)
Q_DISABLE_COPY(QAndroidSystem)
QML_NAMED_ELEMENT(QtAndroidSystem)
QML_SINGLETON
Expand All @@ -52,25 +45,7 @@ class QAndroidSystem : public QObject
Q_INVOKABLE int dipToPx(float dip);
Q_INVOKABLE int ptToPx(float pt);

const QString& getDataLocation() const;
const QString& getConfigLocation() const;
const QString& getDownloadLocation() const;
const QString& getMusicLocation() const;
const QString& getMoviesLocation() const;
const QString& getPicturesLocation() const;

private:
const QJniObject m_javaSystem;
static QAndroidSystem *m_pInstance;

struct {
QString dataLocation;
QString configLocation;
QString downloadLocation;
QString musicLocation;
QString moviesLocation;
QString picturesLocation;
} m_standardPaths;

void loadStandardPaths();
};
59 changes: 0 additions & 59 deletions QtAndroidToolsDemo/tools/AndroidSystem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,5 @@ ScrollablePage {
anchors.fill: parent
spacing: 5

Label {
font.bold: true
font.pixelSize: 15
text: "DataLocation:"
}
Label {
font.pixelSize: 15
text: QtAndroidSystem.dataLocation
}

Label {
font.bold: true
font.pixelSize: 15
text: "ConfigLocation:"
}
Label {
font.pixelSize: 15
text: QtAndroidSystem.configLocation
}

Label {
font.bold: true
font.pixelSize: 15
text: "DownloadLocation:"
}
Label {
font.pixelSize: 15
text: QtAndroidSystem.downloadLocation
}

Label {
font.bold: true
font.pixelSize: 15
text: "MusicLocation:"
}
Label {
font.pixelSize: 15
text: QtAndroidSystem.musicLocation
}

Label {
font.bold: true
font.pixelSize: 15
text: "MoviesLocation:"
}
Label {
font.pixelSize: 15
text: QtAndroidSystem.moviesLocation
}

Label {
font.bold: true
font.pixelSize: 15
text: "PicturesLocation:"
}
Label {
font.pixelSize: 15
text: QtAndroidSystem.picturesLocation
}
}
}

0 comments on commit e1a1649

Please sign in to comment.