Fix Qt compatibility and VM script docs
Updates desktop shell and application code for cross-Qt compatibility: uses begin/endFilterChange for Qt 6.10+, gates LayerShell usage to Qt < 6.5, and adds include handling for generated QML type registration files so nebula-shell builds reliably. Also fixes qInfo size formatting casts and updates README commands to invoke run-sway-vm.sh via `sh` for more portable execution.
This commit is contained in:
@@ -53,7 +53,7 @@ cmake --build build -j$(nproc)
|
|||||||
Then, from the repository root:
|
Then, from the repository root:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./compositor/sway/dev/run-sway-vm.sh
|
sh compositor/sway/dev/run-sway-vm.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
or:
|
or:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ sway -c compositor/sway/nebula-sway.conf
|
|||||||
Recommended on the Ubuntu VMware VM (repo-root `cd`, cursor environment, software cursors):
|
Recommended on the Ubuntu VMware VM (repo-root `cd`, cursor environment, software cursors):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./compositor/sway/dev/run-sway-vm.sh
|
sh compositor/sway/dev/run-sway-vm.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Sway then autostarts Nebula Desktop through `scripts/run-nebula-vm.sh`.
|
Sway then autostarts Nebula Desktop through `scripts/run-nebula-vm.sh`.
|
||||||
@@ -45,7 +45,7 @@ Sway then autostarts Nebula Desktop through `scripts/run-nebula-vm.sh`.
|
|||||||
Skip shell autostart:
|
Skip shell autostart:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
NEBULA_SHELL_AUTOSTART=0 ./compositor/sway/dev/run-sway-vm.sh
|
NEBULA_SHELL_AUTOSTART=0 sh compositor/sway/dev/run-sway-vm.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Output / resolution
|
### Output / resolution
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#include "ApplicationFilterModel.hpp"
|
#include "ApplicationFilterModel.hpp"
|
||||||
#include "ApplicationModel.hpp"
|
#include "ApplicationModel.hpp"
|
||||||
|
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
ApplicationFilterModel::ApplicationFilterModel(QObject *parent)
|
ApplicationFilterModel::ApplicationFilterModel(QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
@@ -25,7 +27,12 @@ void ApplicationFilterModel::setFilter(const QString &filter)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_filter = trimmed;
|
m_filter = trimmed;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||||
|
beginFilterChange();
|
||||||
|
endFilterChange();
|
||||||
|
#else
|
||||||
invalidateFilter();
|
invalidateFilter();
|
||||||
|
#endif
|
||||||
emit filterChanged();
|
emit filterChanged();
|
||||||
emit countChanged();
|
emit countChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void ApplicationService::refresh()
|
|||||||
|
|
||||||
const QStringList directories = applicationDirectories();
|
const QStringList directories = applicationDirectories();
|
||||||
qInfo("nebula: scanning %d application director%s",
|
qInfo("nebula: scanning %d application director%s",
|
||||||
directories.size(),
|
int(directories.size()),
|
||||||
directories.size() == 1 ? "y" : "ies");
|
directories.size() == 1 ? "y" : "ies");
|
||||||
|
|
||||||
for (const QString &directory : directories) {
|
for (const QString &directory : directories) {
|
||||||
@@ -103,7 +103,7 @@ void ApplicationService::refresh()
|
|||||||
}
|
}
|
||||||
|
|
||||||
qInfo("nebula: discovered %d launcher application%s",
|
qInfo("nebula: discovered %d launcher application%s",
|
||||||
entries.size(),
|
int(entries.size()),
|
||||||
entries.size() == 1 ? "" : "s");
|
entries.size() == 1 ? "" : "s");
|
||||||
m_model->setEntries(std::move(entries));
|
m_model->setEntries(std::move(entries));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ sway -c compositor/sway/nebula-sway.conf
|
|||||||
or, recommended on the VM (sets cursor env and starts Sway from the repo root):
|
or, recommended on the VM (sets cursor env and starts Sway from the repo root):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./compositor/sway/dev/run-sway-vm.sh
|
sh compositor/sway/dev/run-sway-vm.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
That should:
|
That should:
|
||||||
|
|||||||
@@ -99,6 +99,19 @@ if(TARGET NebulaApplicationsplugin)
|
|||||||
target_link_libraries(nebula-shell PRIVATE NebulaApplicationsplugin)
|
target_link_libraries(nebula-shell PRIVATE NebulaApplicationsplugin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Generated nebula-shell_qmltyperegistrations.cpp includes "OutputTracker.hpp"
|
||||||
|
# via __has_include. Keep src/ on the include path so that succeeds.
|
||||||
|
target_include_directories(nebula-shell PRIVATE
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||||
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/nebula-shell_qmltyperegistrations.cpp"
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_OPTIONS "-include;${CMAKE_CURRENT_SOURCE_DIR}/src/OutputTracker.hpp"
|
||||||
|
)
|
||||||
|
|
||||||
set_target_properties(nebula-shell PROPERTIES
|
set_target_properties(nebula-shell PROPERTIES
|
||||||
OUTPUT_NAME nebula-shell
|
OUTPUT_NAME nebula-shell
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#include "DesktopIconProvider.hpp"
|
#include "DesktopIconProvider.hpp"
|
||||||
|
|
||||||
#include <LayerShellQt/Shell>
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
@@ -11,6 +9,10 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||||
|
#include <LayerShellQt/Shell>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void initializeIconTheme()
|
void initializeIconTheme()
|
||||||
@@ -45,7 +47,9 @@ void initializeIconTheme()
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||||
LayerShellQt::Shell::useLayerShell();
|
LayerShellQt::Shell::useLayerShell();
|
||||||
|
#endif
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
app.setApplicationName(QStringLiteral("nebula-shell"));
|
app.setApplicationName(QStringLiteral("nebula-shell"));
|
||||||
|
|||||||
Reference in New Issue
Block a user