summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2026-03-05 13:24:29 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2026-03-06 13:05:36 +0000
commita17f8c93048b5af0a3c26110ff3063d28b60b97c (patch)
tree9e70cee3d386a264d05759b1615afc5465b34b9c
parentbd3e438a7dbb04b7f81f4cfccfe78b641d19a493 (diff)
startupscreen: remove all qdb related functionality
Setting QDB mode is no longer supported, and availability of usb networking based on qdb config file is not required either. Remove all code related to these. Change-Id: I9ef01a2eb029e005d9d87ff4d76baf2aa1d2d1e7 Reviewed-by: Ari Parkkila <ari.parkkila@qt.io>
-rw-r--r--startupscreen/MainView.qml1
-rw-r--r--startupscreen/UsbButton.qml5
-rw-r--r--startupscreen/settingsmanager.cpp58
-rw-r--r--startupscreen/settingsmanager.h8
4 files changed, 2 insertions, 70 deletions
diff --git a/startupscreen/MainView.qml b/startupscreen/MainView.qml
index e35b1b1..b9ba8ea 100644
--- a/startupscreen/MainView.qml
+++ b/startupscreen/MainView.qml
@@ -136,7 +136,6 @@ Item {
id: usbButton
height: parent.buttonSize
width: height
- available: SettingsManager.hasQdb
connected: ipAddress.text.indexOf("usb0") !== -1
onPressed: {
usbModeDialog.open()
diff --git a/startupscreen/UsbButton.qml b/startupscreen/UsbButton.qml
index ce4a554..7ffcedf 100644
--- a/startupscreen/UsbButton.qml
+++ b/startupscreen/UsbButton.qml
@@ -54,18 +54,17 @@ import StartupScreen
Item {
id: root
- property bool available: false
property bool connected: false
signal pressed()
- state: !available ? "" : (connected ? "connected" : "error")
+ state: connected ? "connected" : "error"
// changing button state
MouseArea {
anchors.fill: parent
onPressed: root.scale = 0.9
onReleased: root.scale = 1.0
- onClicked: if (available) root.pressed()
+ onClicked: root.pressed()
}
// button icon
diff --git a/startupscreen/settingsmanager.cpp b/startupscreen/settingsmanager.cpp
index ddd964b..a87ae2d 100644
--- a/startupscreen/settingsmanager.cpp
+++ b/startupscreen/settingsmanager.cpp
@@ -60,66 +60,8 @@
#include <sys/reboot.h>
#include <unistd.h>
-const QString QdbdFileName(QStringLiteral("/etc/default/qdbd"));
-const char *ProtocolSetting("USB_ETHERNET_PROTOCOL=");
-
SettingsManager::SettingsManager(QObject *parent) : QObject(parent) {}
-bool SettingsManager::hasQdb()
-{
- return QFile::exists(QdbdFileName);
-}
-
-QString SettingsManager::usbMode()
-{
- static bool initialized = false;
- if (!initialized) {
- QFile file(QdbdFileName);
- if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QByteArray line;
- while (!(line = file.readLine()).isEmpty()) {
- if (line.startsWith(ProtocolSetting))
- m_usbMode =
- QString::fromLatin1(line.last(line.length() - strlen(ProtocolSetting)))
- .trimmed();
- }
- } else {
- qWarning() << "Failed to open file" << QdbdFileName;
- }
- initialized = true;
- }
- return m_usbMode;
-}
-
-void SettingsManager::setUsbMode(const QString &usbMode)
-{
- QFile file(QdbdFileName);
- QTemporaryFile newFile(QdbdFileName);
- newFile.setAutoRemove(false);
- if (!newFile.open()) {
- qWarning() << "Failed to save qdbd settings:" << newFile.errorString();
- return;
- }
-
- if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QTextStream out(&newFile);
- QByteArray line;
- while (!(line = file.readLine()).isEmpty()) {
- if (line.startsWith(ProtocolSetting))
- out << ProtocolSetting << usbMode.toLatin1() << '\n';
- else
- out << line;
- }
-
- file.remove();
- if (!newFile.rename(QdbdFileName))
- qWarning() << "Failed to save qdbd settings:" << newFile.errorString();
-
- } else {
- qWarning() << "Failed to save qdbd settings:" << file.errorString();
- }
-}
-
void SettingsManager::reboot()
{
sync();
diff --git a/startupscreen/settingsmanager.h b/startupscreen/settingsmanager.h
index 6f524cf..241c16e 100644
--- a/startupscreen/settingsmanager.h
+++ b/startupscreen/settingsmanager.h
@@ -58,25 +58,17 @@ class SettingsManager : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString usbMode READ usbMode WRITE setUsbMode)
- Q_PROPERTY(bool hasQdb READ hasQdb CONSTANT)
Q_PROPERTY(QString networks READ networks CONSTANT)
Q_PROPERTY(QByteArray guideText READ guideText CONSTANT)
public:
explicit SettingsManager(QObject *parent = nullptr);
- QString usbMode();
- void setUsbMode(const QString &usbMode);
- bool hasQdb();
Q_INVOKABLE void reboot();
Q_INVOKABLE void runDemoMode(const QString& target);
QString networks();
QByteArray guideText();
-
-private:
- QString m_usbMode;
};
#endif // SETTINGSMANAGER_H