~ubuntu-branches/ubuntu/wily/unity-2d/wily

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/filter.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-08-25 18:16:57 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110825181657-opb29rqsxae3i98f
Tags: 4.2.0-0ubuntu1
* New upstream release:
  - [panel] application menus do not appear on first hover after dismissal
    (lp: #825262)
  - [dash] Lens icons badly scaled (lp: #825368)
  - [panel] indicators are shifted offscreen to the right (lp: #827673)
  - [panel] scrubbing from system indicators to menubar should be possible
    (lp: #706903)
  - [launcher] Closed applications don't get their launcher counts cleared
    (lp: #767367)
  - [dash] selected item should not be underlined but use the same 
    treatment as unity (lp: #817456)
  - [dash] categories should be collapsed by default (lp: #827214)
  - [dash] Ratings filter (lp: #831855)
  - [dash] Multirange filter (lp: #831856)
  - [dash] ToggleButton filter (lp: #831857)
  - [dash] Icon size must be bigger to match the mockups (lp: #831858)
  - [dash] "Refine search" right margin should be 15 pixels (lp: #832058)
  - [dash] "Refine search" should be "Filter results" (lp: #832060)
  - [dash] Font sizes should match new design (lp: #832114)
  - [panel] Glitch: application menu appearing when pressing the BFB 
    (lp: #825060)
  - [panel] Glitch: application menus are quickly opened after a drag gesture
    (lp: #825267)
  - [dash] File thumbnails aspect ratio is not respected (lp: #832204)
* debian/control: require current the current versions of nux and unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
// Self
21
21
#include "filter.h"
22
22
 
 
23
// local
 
24
#include "ratingsfilter.h"
 
25
#include "radiooptionfilter.h"
 
26
#include "checkoptionfilter.h"
 
27
#include "multirangefilter.h"
 
28
 
 
29
// libunity-core
 
30
#include <UnityCore/Filter.h>
 
31
#include <UnityCore/RatingsFilter.h>
 
32
#include <UnityCore/RadioOptionFilter.h>
 
33
#include <UnityCore/CheckOptionFilter.h>
 
34
#include <UnityCore/MultiRangeFilter.h>
 
35
 
 
36
// Qt
 
37
#include <QDebug>
 
38
 
23
39
Filter::Filter(QObject *parent) :
24
40
    QObject(parent)
25
41
{
67
83
}
68
84
 
69
85
 
70
 
void Filter::setUnityFilter(unity::dash::Filter::Ptr filter)
 
86
void Filter::setUnityFilter(unity::dash::Filter::Ptr unityFilter)
71
87
{
72
88
    if (m_unityFilter != NULL) {
73
89
        // FIXME: should disconnect from m_unityFilter's signals
74
90
    }
75
91
 
76
 
    m_unityFilter = filter;
 
92
    m_unityFilter = unityFilter;
77
93
 
78
94
    /* Property change signals */
79
95
    m_unityFilter->id.changed.connect(sigc::mem_fun(this, &Filter::idChanged));
88
104
    m_unityFilter->removed.connect(sigc::mem_fun(this, &Filter::removed));
89
105
}
90
106
 
 
107
Filter* Filter::newFromUnityFilter(unity::dash::Filter::Ptr unityFilter)
 
108
{
 
109
    Filter* filter;
 
110
 
 
111
    if (typeid(*unityFilter) == typeid(unity::dash::RatingsFilter)) {
 
112
        filter = new RatingsFilter;
 
113
    } else if (typeid(*unityFilter) == typeid(unity::dash::CheckOptionFilter)) {
 
114
        filter = new CheckOptionFilter;
 
115
    } else if (typeid(*unityFilter) == typeid(unity::dash::RadioOptionFilter)) {
 
116
        filter = new RadioOptionFilter;
 
117
    } else if (typeid(*unityFilter) == typeid(unity::dash::MultiRangeFilter)) {
 
118
        filter = new MultiRangeFilter;
 
119
    } else {
 
120
        qWarning() << "Filter of unknown type: " << typeid(*unityFilter).name();
 
121
        filter = new Filter;
 
122
    }
 
123
 
 
124
    filter->setUnityFilter(unityFilter);
 
125
    return filter;
 
126
}
 
127
 
 
128
bool Filter::hasUnityFilter(unity::dash::Filter::Ptr unityFilter) const
 
129
{
 
130
    return m_unityFilter == unityFilter;
 
131
}
91
132
 
92
133
#include "filter.moc"