mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
feat:format code
This commit is contained in:
parent
f7cc0e4625
commit
871b5f0edf
@ -65,41 +65,31 @@ static QGSettings *GSettingsByDockApp()
|
||||
}
|
||||
|
||||
AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent)
|
||||
: DockItem(parent),
|
||||
m_appNameTips(new TipsWidget(this)),
|
||||
m_appPreviewTips(nullptr),
|
||||
m_itemEntryInter(new DockEntryInter("com.deepin.dde.daemon.Dock", entry.path(), QDBusConnection::sessionBus(), this)),
|
||||
|
||||
m_swingEffectView(nullptr),
|
||||
m_itemAnimation(nullptr),
|
||||
|
||||
m_wmHelper(DWindowManagerHelper::instance()),
|
||||
|
||||
m_drag(nullptr),
|
||||
|
||||
m_dragging(false),
|
||||
|
||||
m_retryTimes(0),
|
||||
m_lastShowDay(0),
|
||||
m_lastclickTimes(0),
|
||||
|
||||
m_appIcon(QPixmap()),
|
||||
|
||||
m_updateIconGeometryTimer(new QTimer(this)),
|
||||
m_retryObtainIconTimer(new QTimer(this)),
|
||||
m_refershIconTimer(new QTimer(this)),
|
||||
|
||||
m_smallWatcher(new QFutureWatcher<QPixmap>(this)),
|
||||
m_largeWatcher(new QFutureWatcher<QPixmap>(this))
|
||||
: DockItem(parent)
|
||||
, m_appNameTips(new TipsWidget(this))
|
||||
, m_appPreviewTips(nullptr)
|
||||
, m_itemEntryInter(new DockEntryInter("com.deepin.dde.daemon.Dock", entry.path(), QDBusConnection::sessionBus(), this))
|
||||
, m_swingEffectView(nullptr)
|
||||
, m_itemAnimation(nullptr)
|
||||
, m_wmHelper(DWindowManagerHelper::instance())
|
||||
, m_drag(nullptr)
|
||||
, m_dragging(false)
|
||||
, m_retryTimes(0)
|
||||
, m_lastShowDay(0)
|
||||
, m_lastclickTimes(0)
|
||||
, m_appIcon(QPixmap())
|
||||
, m_updateIconGeometryTimer(new QTimer(this))
|
||||
, m_retryObtainIconTimer(new QTimer(this))
|
||||
, m_refershIconTimer(new QTimer(this))
|
||||
, m_smallWatcher(new QFutureWatcher<QPixmap>(this))
|
||||
, m_largeWatcher(new QFutureWatcher<QPixmap>(this))
|
||||
{
|
||||
QHBoxLayout *centralLayout = new QHBoxLayout;
|
||||
centralLayout->setMargin(0);
|
||||
centralLayout->setSpacing(0);
|
||||
|
||||
setAccessibleName(m_itemEntryInter->name());
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
setLayout(centralLayout);
|
||||
|
||||
m_id = m_itemEntryInter->id();
|
||||
@ -155,7 +145,7 @@ const QString AppItem::appId() const
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const bool AppItem::isValid() const
|
||||
bool AppItem::isValid() const
|
||||
{
|
||||
return m_itemEntryInter->isValid() && !m_itemEntryInter->id().isEmpty();
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
~AppItem();
|
||||
|
||||
const QString appId() const;
|
||||
const bool isValid() const;
|
||||
bool isValid() const;
|
||||
void updateWindowIconGeometries();
|
||||
void undock();
|
||||
QWidget *appDragWidget();
|
||||
|
@ -98,7 +98,6 @@ const QPixmap ThemeAppIcon::getIcon(const QString iconName, const int size, cons
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
||||
do {
|
||||
|
||||
// load pixmap from our Cache
|
||||
@ -114,8 +113,7 @@ const QPixmap ThemeAppIcon::getIcon(const QString iconName, const int size, cons
|
||||
}
|
||||
|
||||
// load pixmap from Byte-Data
|
||||
if (iconName.startsWith("data:image/"))
|
||||
{
|
||||
if (iconName.startsWith("data:image/")) {
|
||||
const QStringList strs = iconName.split("base64,");
|
||||
if (strs.size() == 2)
|
||||
pixmap.loadFromData(QByteArray::fromBase64(strs.at(1).toLatin1()));
|
||||
@ -125,8 +123,7 @@ const QPixmap ThemeAppIcon::getIcon(const QString iconName, const int size, cons
|
||||
}
|
||||
|
||||
// load pixmap from File
|
||||
if (QFile::exists(iconName))
|
||||
{
|
||||
if (QFile::exists(iconName)) {
|
||||
pixmap = QPixmap(iconName);
|
||||
if (!pixmap.isNull())
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user