~ubuntu-branches/ubuntu/lucid/ktorrent/lucid

« back to all changes in this revision

Viewing changes to plugins/logviewer/logviewer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Richard Birnie
  • Date: 2008-06-03 20:32:46 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20080603203246-dfyemn010uhsf433
Tags: 3.1~rc1+dfsg.1-1ubuntu1
* New upstream development release      
 - Dropped 01_support_external_libbtcore.diffm,
   97_fix_target_link_libraries.diff,
   99_libbtcore_scramble_soname.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
{
29
29
        const int LOG_EVENT_TYPE = 65432;
30
30
        
31
 
        class LogEvent : public QCustomEvent
 
31
        class LogEvent : public QEvent
32
32
        {
33
33
                QString str;
34
34
        public:
35
 
                LogEvent(const QString & str) : QCustomEvent(LOG_EVENT_TYPE),str(str)
 
35
                LogEvent(const QString & str) : QEvent((QEvent::Type)LOG_EVENT_TYPE),str(str)
36
36
                {}
37
37
                
38
38
                virtual ~LogEvent()
41
41
                const QString & msg() const {return str;}
42
42
        };
43
43
 
44
 
        LogViewer::LogViewer(QWidget *parent, const char *name)
45
 
                        : KTextBrowser(parent, name), LogMonitorInterface()
 
44
        LogViewer::LogViewer(QWidget *parent) : Q3TextBrowser(parent)
46
45
        {
47
46
                /*
48
47
                IMPORTANT: use LogText mode, so that setMaxLogLines will work, if not everything will be kept in memory.
49
48
                */
50
49
                setTextFormat(Qt::LogText);
51
50
                setMaxLogLines(200);
52
 
                setMinimumSize(QSize(0,50));
53
 
                setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
54
 
                KGlobal::config()->setGroup("LogViewer");
55
 
                if (KGlobal::config()->hasKey("LogViewerWidgetSize"))
56
 
                {
57
 
                        QSize s = KGlobal::config()->readSizeEntry("LogViewerWidgetSize",0);
58
 
                        resize(s);
59
 
                }
60
 
                
61
51
                LogFlags::instance().setLog(this);
62
52
        }
63
53
 
64
54
 
65
55
        LogViewer::~LogViewer()
66
56
        {
67
 
                KGlobal::config()->setGroup("LogViewer");
68
 
                KGlobal::config()->writeEntry("LogViewerWidgetSize",size());
69
57
                LogFlags::instance().setLog(0);
70
58
        }
71
59
 
93
81
                }
94
82
        }
95
83
        
96
 
        void LogViewer::customEvent(QCustomEvent* ev)
 
84
        void LogViewer::customEvent(QEvent* ev)
97
85
        {
98
86
                if (ev->type() == LOG_EVENT_TYPE)
99
87
                {