Skip to content

Commit c5e4fb5

Browse files
committed
fix: update building warning.
as title. Log:
1 parent d9378b1 commit c5e4fb5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+139
-35
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ set(CMAKE_AUTOMOC ON)
2323
set(CMAKE_INCLUDE_CURRENT_DIR ON)
2424
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2525
option(BUILD_WITH_X11 "Build X11 emulation" ON)
26-
26+
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
27+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
2728
set(DS_BUILD_WITH_QT6 ON CACHE BOOL "Build dde-shell with Qt6")
2829

2930
if (DS_BUILD_WITH_QT6)

applets/dde-am/amapplet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ static QString unescapeAppIdFromObjectPath(const QString &path)
5757

5858
void AMApplet::onInterfacesRemoved(const QDBusObjectPath &objPath, const QStringList &interfaces)
5959
{
60+
Q_UNUSED(interfaces)
6061
const QString &path(objPath.path());
6162
qDebug() << "InterfacesRemoved by AM, path:" << path;
6263

applets/dde-appearance/appearanceapplet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ AppearanceApplet::AppearanceApplet(QObject *parent)
2121
watcher->addWatchedService("org.deepin.dde.Appearance1");
2222
watcher->setConnection(QDBusConnection::sessionBus());
2323
connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, [this] (const QString & service) {
24+
Q_UNUSED(service)
2425
initDBusProxy();
2526
});
2627
}

applets/dde-apps/amappitem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ static const QString DEFAULT_KEY = "default";
1919
static QString locale = QLocale::system().name();
2020

2121
AMAppItem::AMAppItem(const QDBusObjectPath &path, QObject *parent)
22-
: AppItem(DUtil::unescapeFromObjectPath(path.path().split('/').last()), AppItemModel::AppItemType)
23-
, Application(AM_DBUS_SERVICE, path.path(), QDBusConnection::sessionBus(), parent)
22+
: Application(AM_DBUS_SERVICE, path.path(), QDBusConnection::sessionBus(), parent)
23+
, AppItem(DUtil::unescapeFromObjectPath(path.path().split('/').last()), AppItemModel::AppItemType)
2424
{
2525
}
2626

applets/dde-apps/amappitemmodel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ AMAppItemModel::AMAppItemModel(QObject *parent)
3939
});
4040

4141
connect(m_manager, &ObjectManager::InterfacesRemoved, this, [this](const QDBusObjectPath &objPath, const QStringList &interfaces) {
42+
Q_UNUSED(interfaces)
4243
auto desktopId = DUtil::unescapeFromObjectPath(objPath.path().split('/').last());
4344
auto res = match(index(0, 0), AppItemModel::DesktopIdRole, desktopId);
4445
if (res.isEmpty()) {

applets/dde-apps/appgroupmanager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ namespace apps {
1515
AppGroupManager::AppGroupManager(AMAppItemModel * referenceModel, QObject *parent)
1616
: QStandardItemModel(parent)
1717
, m_referenceModel(referenceModel)
18-
, m_config(Dtk::Core::DConfig::create("org.deepin.dde.shell", "org.deepin.ds.dde-apps", "", this))
1918
, m_dumpTimer(new QTimer(this))
19+
, m_config(Dtk::Core::DConfig::create("org.deepin.dde.shell", "org.deepin.ds.dde-apps", "", this))
2020
{
2121
m_dumpTimer->setSingleShot(true);
2222
m_dumpTimer->setInterval(1000);
@@ -295,7 +295,7 @@ void AppGroupManager::launchpadArrangementConfigMigration()
295295
itemArrangementSettings.beginGroup(groupName);
296296
QString folderName = itemArrangementSettings.value("name", QString()).toString();
297297
int pageCount = itemArrangementSettings.value("pageCount", 0).toInt();
298-
bool isTopLevel = groupName == "toplevel";
298+
// bool isTopLevel = groupName == "toplevel"; // 未使用的变量
299299

300300
QVariantMap valueMap;
301301
valueMap.insert("name", folderName);
@@ -344,7 +344,7 @@ void AppGroupManager::loadAppGroupInfo()
344344
if (groupId.isEmpty()) {
345345
groupId = assignGroupId();
346346
}
347-
auto p = appendGroup(groupId, name, items);
347+
appendGroup(groupId, name, items); // 不需要使用返回值
348348
}
349349

350350
// always ensure top-level group exists

applets/dde-apps/appsdockedhelper.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ AppsDockedHelper::AppsDockedHelper(QObject *parent)
3434
YAML::Node node;
3535
try {
3636
node = YAML::Load("{" + dcokedDesktopFilesStr.toStdString() + "}");
37-
} catch (YAML::Exception) {
37+
} catch (const YAML::Exception&) {
3838
qWarning() << "unable to parse docked desktopfiles";
3939
}
4040

@@ -66,6 +66,8 @@ bool AppsDockedHelper::isDocked(const QString &appItemId) const
6666

6767
void AppsDockedHelper::setDocked(const QString &appId, bool docked)
6868
{
69+
Q_UNUSED(appId)
70+
Q_UNUSED(docked)
6971
// TODO
7072
}
7173
}

frame/appletdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DAppletData::DAppletData(const QVariantMap &data)
2929
}
3030

3131
DAppletData::DAppletData(const DAppletData &other)
32-
: d(other.d)
32+
: QObject(), d(other.d)
3333
{
3434
}
3535

frame/layershell/dlayershellwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ DLayerShellWindow::DLayerShellWindow(QWindow* window)
212212
waylandWindow->setShellIntegration(shellIntegration);
213213
}
214214
#ifdef BUILD_WITH_X11
215-
else if (auto xcbWindow = dynamic_cast<QNativeInterface::Private::QXcbWindow*>(window->handle())) {
215+
else if (dynamic_cast<QNativeInterface::Private::QXcbWindow*>(window->handle())) {
216216
new LayerShellEmulation(window, this);
217217
qCInfo(layershellwindow) << "not a wayland window, try to emulate on x11";
218218
}

frame/layershell/x11dlayershellemulation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ LayerShellEmulation::LayerShellEmulation(QWindow* window, QObject *parent)
5959
});
6060
connect(qApp, &QGuiApplication::primaryScreenChanged, &m_exclusionZoneChangedTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
6161
connect(m_window, &QWindow::screenChanged, this, [this](QScreen *nowScreen){
62+
Q_UNUSED(nowScreen)
6263
onPositionChanged();
6364
m_exclusionZoneChangedTimer.start();
6465
});

0 commit comments

Comments
 (0)