~ubuntu-branches/ubuntu/maverick/luckybackup/maverick

« back to all changes in this revision

Viewing changes to src/logDialog.cpp

  • Committer: Andrew Starr-Bochicchio
  • Date: 2010-05-26 04:01:25 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: a.starr.b@gmail.com-20100526040125-9fjy5y0jyzlrbkny
Tags: 0.4.0-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
 - Use gksu to launch in superuser mode as Ubuntu
   doesn't use su-to-root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
===============================================================================================================================
5
5
===============================================================================================================================
6
6
     This file is part of "luckyBackup" project
7
 
     Copyright 2008-2009, Loukas Avgeriou
 
7
     Copyright 2008-2010, Loukas Avgeriou
8
8
     luckyBackup is distributed under the terms of the GNU General Public License
9
9
     luckyBackup is free software: you can redistribute it and/or modify
10
10
     it under the terms of the GNU General Public License as published by
61
61
                }
62
62
                else
63
63
                {
 
64
                                
64
65
                        QTextStream in(&logfile);
 
66
                        int countLine = 0;
65
67
                        while (!in.atEnd())     // read the logfile line by line
66
68
                        {
67
69
                                QString logLine = in.readLine();
 
70
                                countLine++;
68
71
                                logLine.append("<br>");
69
72
                                logText.append(logLine);
70
73
                                
71
74
                                if (logLine.startsWith("<a name=\"error"))      // if the line is an error update the relevant errorLine Qstring
72
75
                                {
73
76
                                        //errorLine[errorCount] = logLine;
74
 
                                        errorLine[errorCount] = "error" + countStr.setNum(errorCount+1);
 
77
                                        errorLine.append("error" + countStr.setNum(errorCount+1));
75
78
                                        errorCount++;
76
79
                                }
 
80
                                if (countLine > 50000)
 
81
                                {
 
82
                                        logText.append("<br><br><font color=magenta><b>" + tr("Displaying first 50000 lines of logfile") + "</b></font>");
 
83
                                        break;
 
84
                                }
 
85
                                
77
86
                        }
78
87
                        logfile.close();
79
88
                        totalErrors = errorCount;
84
93
                        firstScroll=TRUE;
85
94
                }
86
95
        }
87
 
        
88
96
        uiL.logView -> setText(logText);
89
97
}
90
98