~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/widgets/common/splashscreen.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
};
82
82
 
83
83
SplashScreen::SplashScreen()
84
 
            : KSplashScreen(QPixmap()), d(new SplashScreenPriv)
 
84
    : KSplashScreen(QPixmap()), d(new SplashScreenPriv)
85
85
{
86
86
    if (KGlobal::mainComponent().aboutData()->appName() == QString("digikam"))
87
87
    {
92
92
        setPixmap(KStandardDirs::locate("data","showfoto/data/splash-showfoto.png"));
93
93
    }
94
94
 
95
 
    QTimer *timer = new QTimer( this );
 
95
    QTimer* timer = new QTimer( this );
96
96
 
97
97
    connect(timer, SIGNAL(timeout()),
98
98
            this, SLOT(animate()));
118
118
void SplashScreen::animate()
119
119
{
120
120
    QTime currentTime = QTime::currentTime();
 
121
 
121
122
    if (d->lastStateUpdateTime.msecsTo(currentTime) > 100)
122
123
    {
123
124
        d->state = ((d->state + 1) % (2*d->progressBarSize-1));
124
125
        d->lastStateUpdateTime = currentTime;
125
126
    }
 
127
 
126
128
    update();
127
129
}
128
130
 
156
158
    for (int i = 0; i < d->progressBarSize; ++i)
157
159
    {
158
160
        position = (d->state+i)%(2*d->progressBarSize-1);
 
161
 
159
162
        if (position < 3)
160
163
        {
161
164
            p->setBrush(QColor(basecolor.red()  -18*i,
178
181
    // Draw message at given position, limited to 43 chars
179
182
    // If message is too long, string is truncated
180
183
    if (d->message.length() > 50)
 
184
    {
181
185
        d->message.truncate(49);
 
186
    }
182
187
 
183
188
    d->message += "...";
184
189
    p->setPen(d->messageColor);