-rw-r--r-- | noncore/settings/sysinfo/sysloginfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/sysinfo/sysloginfo.cpp b/noncore/settings/sysinfo/sysloginfo.cpp index a9e98e3..21427f4 100644 --- a/noncore/settings/sysinfo/sysloginfo.cpp +++ b/noncore/settings/sysinfo/sysloginfo.cpp | |||
@@ -41,50 +41,50 @@ using namespace Opie::Ui; | |||
41 | /* STD */ | 41 | /* STD */ |
42 | #include <sys/klog.h> | 42 | #include <sys/klog.h> |
43 | #include <sys/types.h> | 43 | #include <sys/types.h> |
44 | #include <sys/stat.h> | 44 | #include <sys/stat.h> |
45 | #include <fcntl.h> | 45 | #include <fcntl.h> |
46 | #include <assert.h> | 46 | #include <assert.h> |
47 | #include <unistd.h> | 47 | #include <unistd.h> |
48 | #include <string.h> | 48 | #include <string.h> |
49 | #include <errno.h> | 49 | #include <errno.h> |
50 | 50 | ||
51 | #define SYSLOG_READ 2 | 51 | #define SYSLOG_READ 2 |
52 | #define SYSLOG_READ_ALL 3 | 52 | #define SYSLOG_READ_ALL 3 |
53 | #define SYSLOG_READ_ALL_CLEAR 4 | 53 | #define SYSLOG_READ_ALL_CLEAR 4 |
54 | #define SYSLOG_UNREAD 9 | 54 | #define SYSLOG_UNREAD 9 |
55 | 55 | ||
56 | #undef APPEND | 56 | #undef APPEND |
57 | 57 | ||
58 | const unsigned int bufsize = 16384; | 58 | const unsigned int bufsize = 16384; |
59 | char buf[bufsize]; | 59 | char buf[bufsize]; |
60 | 60 | ||
61 | SyslogInfo::SyslogInfo( QWidget* parent, const char* name, WFlags fl ) | 61 | SyslogInfo::SyslogInfo( QWidget* parent, const char* name, WFlags fl ) |
62 | : QWidget( parent, name, fl ) | 62 | : QWidget( parent, name, fl ) |
63 | { | 63 | { |
64 | QGridLayout *layout = new QGridLayout( this ); | 64 | QGridLayout *layout = new QGridLayout( this ); |
65 | layout->setSpacing( 4 ); | 65 | layout->setSpacing( 2 ); |
66 | layout->setMargin( 4 ); | 66 | layout->setMargin( 0 ); |
67 | 67 | ||
68 | syslogview = new QTextView( this ); | 68 | syslogview = new QTextView( this ); |
69 | syslogview->setTextFormat( PlainText ); | 69 | syslogview->setTextFormat( PlainText ); |
70 | OConfig cfg( "qpe" ); | 70 | OConfig cfg( "qpe" ); |
71 | cfg.setGroup( "Appearance" ); | 71 | cfg.setGroup( "Appearance" ); |
72 | syslogview->setFont( QFont( "Fixed", cfg.readNumEntry( "FontSize", 10 ) ) ); | 72 | syslogview->setFont( QFont( "Fixed", cfg.readNumEntry( "FontSize", 10 ) ) ); |
73 | layout->addWidget( syslogview, 0, 0 ); | 73 | layout->addWidget( syslogview, 0, 0 ); |
74 | syslogview->setText( "..." ); | 74 | syslogview->setText( "..." ); |
75 | 75 | ||
76 | memset( buf, 0, bufsize ); | 76 | memset( buf, 0, bufsize ); |
77 | ::klogctl( SYSLOG_READ_ALL, buf, bufsize ); | 77 | ::klogctl( SYSLOG_READ_ALL, buf, bufsize ); |
78 | syslogview->setText( buf ); | 78 | syslogview->setText( buf ); |
79 | 79 | ||
80 | #ifdef APPEND | 80 | #ifdef APPEND |
81 | fd = ::open( "/proc/kmsg", O_RDONLY|O_SYNC ); | 81 | fd = ::open( "/proc/kmsg", O_RDONLY|O_SYNC ); |
82 | if ( fd == -1 ) | 82 | if ( fd == -1 ) |
83 | { | 83 | { |
84 | syslogview->setText( "Couldn't open /proc/kmsg: " + QString( strerror( errno ) ) ); | 84 | syslogview->setText( "Couldn't open /proc/kmsg: " + QString( strerror( errno ) ) ); |
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | QSocketNotifier *sn = new QSocketNotifier( fd, QSocketNotifier::Read, this ); | 87 | QSocketNotifier *sn = new QSocketNotifier( fd, QSocketNotifier::Read, this ); |
88 | QObject::connect( sn, SIGNAL(activated(int)), this, SLOT(updateData()) ); | 88 | QObject::connect( sn, SIGNAL(activated(int)), this, SLOT(updateData()) ); |
89 | #else | 89 | #else |
90 | QPushButton* pb = new QPushButton( "&Refresh", this ); | 90 | QPushButton* pb = new QPushButton( "&Refresh", this ); |