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

« back to all changes in this revision

Viewing changes to kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2012-10-07 16:52:45 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20121007165245-91bwt6kz9z4t3ak9
Tags: 1:2.5.3-0ubuntu1
New upstream bugfix release

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
void SQLiteVacuum::dumpProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
180
180
{
181
181
    KexiDBDrvDbg << exitCode << exitStatus;
 
182
    if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
 
183
        cancelClicked();
 
184
        m_result = false;
 
185
    }
 
186
 
182
187
    if (m_dlg) {
183
188
        m_dlg->close();
184
189
        delete m_dlg;
185
190
        m_dlg = 0;
186
191
    }
187
 
}
188
 
 
189
 
void SQLiteVacuum::sqliteProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
190
 
{
191
 
    KexiDBDrvDbg << exitCode << exitStatus;
192
 
 
193
 
    const uint origSize = QFileInfo(m_filePath).size();
194
 
 
195
 
    if (0 != KDE::rename(m_tmpFilePath, m_filePath)) {
196
 
        kWarning() << "Rename" << m_tmpFilePath << "to" << m_filePath << "failed.";
 
192
 
 
193
    if (true != m_result) {
 
194
        return;
 
195
    }
 
196
 
 
197
    QFileInfo fi(m_filePath);
 
198
    const uint origSize = fi.size();
 
199
 
 
200
    if (0 != KDE::rename(m_tmpFilePath, fi.absoluteFilePath())) {
 
201
        kWarning() << "Rename" << m_tmpFilePath << "to" << fi.absoluteFilePath() << "failed.";
197
202
        m_result = false;
198
203
    }
199
204
 
200
205
    if (m_result == true) {
201
 
        const uint newSize = QFileInfo(m_filePath).size();
 
206
        const uint newSize = fi.size();
202
207
        const uint decrease = 100 - 100 * newSize / origSize;
203
208
        KMessageBox::information(0, i18n("The database has been compacted. Current size decreased by %1% to %2.", decrease, KIO::convertSize(newSize)));
204
209
    }
205
210
}
206
211
 
 
212
void SQLiteVacuum::sqliteProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
 
213
{
 
214
    KexiDBDrvDbg << exitCode << exitStatus;
 
215
 
 
216
    if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
 
217
        m_result = false;
 
218
        return;
 
219
    }
 
220
}
 
221
 
207
222
void SQLiteVacuum::cancelClicked()
208
223
{
209
224
        //m_dumpProcess->terminate();