Skip to content

Commit

Permalink
rix: some minor issues
Browse files Browse the repository at this point in the history
解决多个警告的小问题
  • Loading branch information
myml committed Nov 16, 2024
1 parent 01db408 commit 8d11e3b
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 25 deletions.
1 change: 0 additions & 1 deletion calendar-client/src/customWidget/jobtypelistview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ void JobTypeListView::slotImportScheduleType()
KCalendarCore::ICalFormat icalformat;
QTimeZone timezone = QDateTime::currentDateTime().timeZone();
KCalendarCore::MemoryCalendar::Ptr cal(new KCalendarCore::MemoryCalendar(timezone));
auto ok = icalformat.load(cal, filename);
auto typeID = cal->nonKDECustomProperty("X-DDE-CALENDAR-TYPE-ID");
auto typeName = cal->nonKDECustomProperty("X-DDE-CALENDAR-TYPE-NAME");
auto typeColor = cal->nonKDECustomProperty("X-DDE-CALENDAR-TYPE-COLOR");
Expand Down
2 changes: 1 addition & 1 deletion calendar-client/src/customWidget/scheduleview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ void CScheduleView::resizeEvent(QResizeEvent *event)

void CScheduleView::wheelEvent(QWheelEvent *e)
{
if (e->angleDelta().x() != 0 ) {
if (e->angleDelta().x() != 0) {
emit signalAngleDelta(e->angleDelta().x());
}
}
Expand Down
2 changes: 0 additions & 2 deletions calendar-client/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ int main(int argc, char *argv[])
DLogManager::registerConsoleAppender();
DLogManager::registerFileAppender();
DLogManager::registerJournalAppender();
//获取应用配置
DApplicationSettings applicationset(app);
//为了与老版本配置兼容
Calendarmainwindow ww(viewtype - 1);
ExportedInterface einterface(&ww);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <QGraphicsScene>
#include <QDebug>
#include <QMarginsF>
#include <algorithm>

CSceneBackgroundItem::CSceneBackgroundItem(ItemOnView view, QGraphicsItem *parent)
: CFocusItem(parent)
Expand Down Expand Up @@ -93,7 +94,7 @@ void CSceneBackgroundItem::updateShowItem()
m_item.append(item);
}
}
qSort(m_item.begin(), m_item.end(), compareItemData);
std::sort(m_item.begin(), m_item.end(), compareItemData);
updateCurrentItemShow();
}

Expand Down
12 changes: 6 additions & 6 deletions calendar-client/src/widget/calendarmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <QSizePolicy>
#include <QHBoxLayout>
#include <QWidget>
#include <QScreen>
#include <QMenuBar>
#include <QMouseEvent>
#include <QColorDialog>
Expand Down Expand Up @@ -97,11 +98,11 @@ Calendarmainwindow::Calendarmainwindow(int index, QWidget *w)
connect(viewshortcut, SIGNAL(activated()), this, SLOT(slotViewShortcut()));

setTitlebarShadowEnabled(true);
//获取桌面窗口大小
QDesktopWidget *desktopwidget = QApplication::desktop();
//若分辨率改变则重新设置最大尺寸
connect(desktopwidget, &QDesktopWidget::resized, this, &Calendarmainwindow::slotSetMaxSize);
slotSetMaxSize();
const auto screens = QGuiApplication::screens();
for (QScreen *screen : screens) {
connect(screen, &QScreen::geometryChanged, this, &Calendarmainwindow::slotSetMaxSize);
}

//兼容以前的配置信息
if (CConfigSettings::getInstance()->contains("base.geometry")) {
Expand Down Expand Up @@ -789,9 +790,8 @@ void Calendarmainwindow::slotDeleteitem()
* @brief Calendarmainwindow::slotSetMaxSize 根据屏幕分辨率调整窗口最大尺寸
* @param size
*/
void Calendarmainwindow::slotSetMaxSize(int size)
void Calendarmainwindow::slotSetMaxSize()
{
Q_UNUSED(size);
//获取屏幕大小
QSize deskSize = QApplication::desktop()->size();
//设置最大尺寸为屏幕尺寸
Expand Down
2 changes: 1 addition & 1 deletion calendar-client/src/widget/calendarmainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private slots:
//快捷键删除选中日程
void slotDeleteitem();
//设置最大大小
void slotSetMaxSize(int size = 0);
void slotSetMaxSize();
void slotSearchFocusSwitch();
//帐户侧边栏状态发生改变事件
void slotSidebarStatusChange(bool);
Expand Down
2 changes: 1 addition & 1 deletion calendar-client/src/widget/dayWidget/daymonthview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void CDayMonthView::paintEvent(QPaintEvent *e)
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
painter.save();
painter.setBrush(aniPa.background());
painter.setBrush(aniPa.window());
painter.setPen(Qt::NoPen);
QPainterPath painterPath;
painterPath.moveTo(0, 0);
Expand Down
2 changes: 1 addition & 1 deletion calendar-client/src/widget/monthWidget/monthdayview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void CMonthDayView::setSearchflag(bool flag)
void CMonthDayView::wheelEvent(QWheelEvent *e)
{
//如果滚动为左右则触发信号
if (e->angleDelta().x() != 0 ) {
if (e->angleDelta().x() != 0) {
emit signalAngleDelta(e->angleDelta().x());
} else {
emit signalAngleDelta(e->angleDelta().y());
Expand Down
2 changes: 1 addition & 1 deletion calendar-client/src/widget/weekWidget/weekheadview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void CWeekHeadView::paintCell(QWidget *cell)
void CWeekHeadView::wheelEvent(QWheelEvent *e)
{
//如果滚轮为左右方向则触发信号
if (e->angleDelta().x() != 0 ) {
if (e->angleDelta().x() != 0) {
emit signalAngleDelta(e->angleDelta().x());
}
}
Expand Down
1 change: 0 additions & 1 deletion calendar-service/src/dbmanager/daccountdatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ QString DAccountDataBase::createSchedule(const DSchedule::Ptr &schedule)
}

} else {
schedule->setUid("");
qCWarning(ServiceLogger) << "schedule is null";
}

Expand Down
18 changes: 9 additions & 9 deletions translations/dde-calendar_en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<context>
<name>AccountManager</name>
<message>
<location filename="../calendar-client/src/dataManage/accountmanager.cpp" line="223"/>
<location filename="../calendar-client/src/dataManage/accountmanager.cpp" line="227"/>
<source>Local account</source>
<translation>Local account</translation>
</message>
<message>
<location filename="../calendar-client/src/dataManage/accountmanager.cpp" line="225"/>
<location filename="../calendar-client/src/dataManage/accountmanager.cpp" line="229"/>
<source>Event types</source>
<translation>Event types</translation>
</message>
Expand Down Expand Up @@ -142,7 +142,7 @@
<translation>New event</translation>
</message>
<message>
<location filename="../calendar-client/src/widget/monthWidget/monthview.cpp" line="209"/>
<location filename="../calendar-client/src/widget/monthWidget/monthview.cpp" line="211"/>
<source>New Event</source>
<translation>New Event</translation>
</message>
Expand Down Expand Up @@ -879,17 +879,17 @@
<translation>Privacy Policy</translation>
</message>
<message>
<location filename="../calendar-client/src/widget/calendarmainwindow.cpp" line="940"/>
<location filename="../calendar-client/src/widget/calendarmainwindow.cpp" line="939"/>
<source>Syncing...</source>
<translation>Syncing...</translation>
</message>
<message>
<location filename="../calendar-client/src/widget/calendarmainwindow.cpp" line="950"/>
<location filename="../calendar-client/src/widget/calendarmainwindow.cpp" line="949"/>
<source>Sync successful</source>
<translation>Sync successful</translation>
</message>
<message>
<location filename="../calendar-client/src/widget/calendarmainwindow.cpp" line="958"/>
<location filename="../calendar-client/src/widget/calendarmainwindow.cpp" line="957"/>
<source>Sync failed, please try later</source>
<translation>Sync failed, please try later</translation>
</message>
Expand Down Expand Up @@ -991,12 +991,12 @@
<context>
<name>JobTypeListView</name>
<message>
<location filename="../calendar-client/src/customWidget/jobtypelistview.cpp" line="142"/>
<location filename="../calendar-client/src/customWidget/jobtypelistview.cpp" line="143"/>
<source>export</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calendar-client/src/customWidget/jobtypelistview.cpp" line="213"/>
<location filename="../calendar-client/src/customWidget/jobtypelistview.cpp" line="214"/>
<source>import ICS file</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -1243,7 +1243,7 @@
<context>
<name>YearFrame</name>
<message>
<location filename="../calendar-client/src/widget/yearWidget/yearwindow.cpp" line="925"/>
<location filename="../calendar-client/src/widget/yearWidget/yearwindow.cpp" line="929"/>
<source>Y</source>
<translation>Y</translation>
</message>
Expand Down

0 comments on commit 8d11e3b

Please sign in to comment.