~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to plugins/musicshape/actions/NoteEntryAction.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "../commands/AddNoteCommand.h"
38
38
#include "../commands/MakeRestCommand.h"
39
39
 
40
 
#include <kicon.h>
 
40
#include <KoIcon.h>
 
41
 
41
42
#include <kdebug.h>
42
43
#include <klocale.h>
43
44
 
47
48
 
48
49
static KIcon getIcon(Duration duration, bool isRest)
49
50
{
50
 
    QString base = isRest ? "music-rest-" : "music-note-";
51
 
    switch (duration) {
52
 
        case BreveNote:          return KIcon(base + "breve");
53
 
        case WholeNote:          return KIcon(base + "whole");
54
 
        case HalfNote:           return KIcon(base + "half");
55
 
        case QuarterNote:        return KIcon(base + "quarter");
56
 
        case EighthNote:         return KIcon(base + "eighth");
57
 
        case SixteenthNote:      return KIcon(base + "16th");
58
 
        case ThirtySecondNote:   return KIcon(base + "32nd");
59
 
        case SixtyFourthNote:    return KIcon(base + "64th");
60
 
        case HundredTwentyEighthNote: return KIcon(base + "128th");
61
 
    }
62
 
    return KIcon();
 
51
    const char *const id =
 
52
        (duration == BreveNote) ? (isRest?koIconNameCStr("music-rest-breve"):koIconNameCStr("music-note-breve")) :
 
53
        (duration == WholeNote) ? (isRest?koIconNameCStr("music-rest-whole"):koIconNameCStr("music-note-whole")) :
 
54
        (duration == HalfNote) ? (isRest?koIconNameCStr("music-rest-half"):koIconNameCStr("music-note-half")) :
 
55
        (duration == QuarterNote) ? (isRest?koIconNameCStr("music-rest-quarter"):koIconNameCStr("music-note-quarter")) :
 
56
        (duration == EighthNote) ? (isRest?koIconNameCStr("music-rest-eighth"):koIconNameCStr("music-note-eighth")) :
 
57
        (duration == SixteenthNote) ? (isRest?koIconNameCStr("music-rest-16th"):koIconNameCStr("music-note-16th")) :
 
58
        (duration == ThirtySecondNote) ? (isRest?koIconNameCStr("music-rest-32nd"):koIconNameCStr("music-note-32nd")) :
 
59
        (duration == SixtyFourthNote) ? (isRest?koIconNameCStr("music-rest-64th"):koIconNameCStr("music-note-64th")) :
 
60
        (duration == HundredTwentyEighthNote) ? (isRest?koIconNameCStr("music-rest-128th"):koIconNameCStr("music-note-128th")) :
 
61
        0;
 
62
 
 
63
    return KIcon(QLatin1String(id));
63
64
}
64
65
 
65
66
static QString getText(Duration duration, bool isRest)