~ubuntu-branches/debian/experimental/qtcurve/experimental

« back to all changes in this revision

Viewing changes to lib/utils/qtprops.h

  • Committer: Package Import Robot
  • Author(s): Boris Pek, Thanks to Scarlett Clark
  • Date: 2015-07-26 04:17:05 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20150726041705-yuxbierbpely1fvp
Tags: 1.8.18+git20150711-a3fff13-1
* Upstream Git snapshot (1.8.18-242-ga3fff13) is taken from:
  http://quickgit.kde.org/?p=qtcurve.git
* Localization files are taken from last stable release (1.8.18).
* Fixed in upstream:
  - gtk2-engines-qtcurve: inkscape 0.91 crashes after palette mouse-over
    (Closes: #786831)
  - gtk2-engines-qtcurve: massive memory leak in mysql-workbench
    (Closes: #682162)
* Update debian/patches:
  - delete qt53-build-fix.diff (fixed in upstream)
  - add enable-translations.patch
* Update debian/control:
  - bump Standards-Version to 3.9.6 (was 3.9.5): no changes required
  - update Build-Depends for transition from KDE4 to KF5:
    + delete dependencies from: kdebase-workspace-dev and qtdeclarative5-dev
    + add dependencies from: extra-cmake-modules, kio-dev,
      libkf5archive-dev, libkf5config-dev, libkf5configwidgets-dev,
      libkf5i18n-dev, libkf5kdelibs4support-dev, libkf5widgetsaddons-dev,
      libkf5xmlgui-dev, libqt5x11extras5-dev, libxcb1-dev, pkg-config
      [Thanks to Scarlett Clark]
  - delete package kwin-style-qtcurve: it is not available for KF5 yet
    (LP: #1452218)
  - package kde-style-qtcurve now provides package kde-style-qtcurve-qt4
  - package kde-style-qtcurve is "Multi-Arch: same" now
  - metapackage qtcurve now depends on kde-style-qtcurve-qt5 and recommends
    kwin-decoration-oxygen, oxygen-icon-theme and oxygencursors
* Update debian/rules:
  - build using kf5 libraries instead of kde4
  - update configure flags
  - use xz compression in packages
* Update debian/kde-style-qtcurve.install:
  there are no KDE4 related files anymore.
* Update debian/kde-style-qtcurve-qt5.install.
* Update debian/copyright.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
 
 *   Copyright 2013 - 2014 Yichao Yu <yyc1992@gmail.com>                     *
 
2
 *   Copyright 2013 - 2015 Yichao Yu <yyc1992@gmail.com>                     *
3
3
 *                                                                           *
4
4
 *   This program is free software; you can redistribute it and/or modify    *
5
5
 *   it under the terms of the GNU Lesser General Public License as          *
57
57
 
58
58
#define QTC_PROP_NAME "_q__QTCURVE_WIDGET_PROPERTIES__"
59
59
 
60
 
QTC_ALWAYS_INLINE static inline QSharedPointer<_QtcQWidgetProps>
61
 
qtcGetWidgetProps(const QWidget *w)
62
 
{
63
 
    // use _q_ to mimic qt internal properties and suppress QtDesigner
64
 
    // warning about unsupported properties.
65
 
    QVariant val(w->property(QTC_PROP_NAME));
66
 
    if (!val.isValid()) {
67
 
        val = QVariant::fromValue(QSharedPointer<_QtcQWidgetProps>(
68
 
                                      new _QtcQWidgetProps));
69
 
        const_cast<QWidget*>(w)->setProperty(QTC_PROP_NAME, val);
70
 
    }
71
 
    return val.value<QSharedPointer<_QtcQWidgetProps> >();
72
 
}
73
 
 
74
60
class QtcQWidgetProps {
 
61
    typedef QSharedPointer<_QtcQWidgetProps> prop_type;
 
62
    inline prop_type
 
63
    getProps() const
 
64
    {
 
65
        // use _q_ to mimic qt internal properties and suppress QtDesigner
 
66
        // warning about unsupported properties.
 
67
        QVariant val(m_w->property(QTC_PROP_NAME));
 
68
        if (!val.isValid()) {
 
69
            val = QVariant::fromValue(QSharedPointer<_QtcQWidgetProps>(
 
70
                                          new _QtcQWidgetProps));
 
71
            const_cast<QWidget*>(m_w)->setProperty(QTC_PROP_NAME, val);
 
72
        }
 
73
        return val.value<prop_type>();
 
74
    }
75
75
public:
76
 
    QtcQWidgetProps(const QWidget *widget): w(widget), p(0) {}
 
76
    QtcQWidgetProps(const QWidget *widget): m_w(widget), m_p(0) {}
77
77
    inline _QtcQWidgetProps*
78
 
    operator ->() const
 
78
    operator->() const
79
79
    {
80
 
        if (!p && w) {
81
 
            p = qtcGetWidgetProps(w);
 
80
        if (!m_p && m_w) {
 
81
            m_p = getProps();
82
82
        }
83
 
        return p.data();
 
83
        return m_p.data();
84
84
    }
85
85
private:
86
 
    const QWidget *w;
87
 
    mutable QSharedPointer<_QtcQWidgetProps> p;
 
86
    const QWidget *m_w;
 
87
    mutable prop_type m_p;
88
88
};
89
89
 
90
90
static inline int