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:
|
||||
|
||||
```bash
|
||||
./compositor/sway/dev/run-sway-vm.sh
|
||||
sh compositor/sway/dev/run-sway-vm.sh
|
||||
```
|
||||
|
||||
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):
|
||||
|
||||
```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`.
|
||||
@@ -45,7 +45,7 @@ Sway then autostarts Nebula Desktop through `scripts/run-nebula-vm.sh`.
|
||||
Skip shell autostart:
|
||||
|
||||
```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
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "ApplicationFilterModel.hpp"
|
||||
#include "ApplicationModel.hpp"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
ApplicationFilterModel::ApplicationFilterModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
@@ -25,7 +27,12 @@ void ApplicationFilterModel::setFilter(const QString &filter)
|
||||
return;
|
||||
|
||||
m_filter = trimmed;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
|
||||
beginFilterChange();
|
||||
endFilterChange();
|
||||
#else
|
||||
invalidateFilter();
|
||||
#endif
|
||||
emit filterChanged();
|
||||
emit countChanged();
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ void ApplicationService::refresh()
|
||||
|
||||
const QStringList directories = applicationDirectories();
|
||||
qInfo("nebula: scanning %d application director%s",
|
||||
directories.size(),
|
||||
int(directories.size()),
|
||||
directories.size() == 1 ? "y" : "ies");
|
||||
|
||||
for (const QString &directory : directories) {
|
||||
@@ -103,7 +103,7 @@ void ApplicationService::refresh()
|
||||
}
|
||||
|
||||
qInfo("nebula: discovered %d launcher application%s",
|
||||
entries.size(),
|
||||
int(entries.size()),
|
||||
entries.size() == 1 ? "" : "s");
|
||||
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):
|
||||
|
||||
```bash
|
||||
./compositor/sway/dev/run-sway-vm.sh
|
||||
sh compositor/sway/dev/run-sway-vm.sh
|
||||
```
|
||||
|
||||
That should:
|
||||
|
||||
@@ -99,6 +99,19 @@ if(TARGET NebulaApplicationsplugin)
|
||||
target_link_libraries(nebula-shell PRIVATE NebulaApplicationsplugin)
|
||||
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
|
||||
OUTPUT_NAME nebula-shell
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "DesktopIconProvider.hpp"
|
||||
|
||||
#include <LayerShellQt/Shell>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QGuiApplication>
|
||||
@@ -11,6 +9,10 @@
|
||||
#include <QUrl>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
#include <LayerShellQt/Shell>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
void initializeIconTheme()
|
||||
@@ -45,7 +47,9 @@ void initializeIconTheme()
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
LayerShellQt::Shell::useLayerShell();
|
||||
#endif
|
||||
|
||||
QGuiApplication app(argc, argv);
|
||||
app.setApplicationName(QStringLiteral("nebula-shell"));
|
||||
|
||||
Reference in New Issue
Block a user