Added old KDE3 version of ksystemlog

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksystemlog@1095334 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
commit 64e7bb523f

@ -0,0 +1,3 @@
Nicolas Ternisien <nicolas.ternisien@gmail.com>
Please see http://annivernet.free.fr/ksystemlog/ for more informations.

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -0,0 +1,16 @@
----------------------------------
KSystemLog Changelog
----------------------------------
Please see the changelog of KSystemLog online at :
http://annivernet.free.fr/ksystemlog/changelog.php
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

@ -0,0 +1,181 @@
Specific Trouble case with KSystemLog
===================================================
I hope that you will don't have any problems to compile and test KSystemLog.
If you successfully compile KSystemLog but you have strange problems (with the
tool bars, please manually copy src/ksystemlogui.rc in the $HOME/.kde/share/apps/ksystemlog
folder (create it if it does not exist).
If you still have problems, do not hesitate do email me ;-)
Nicolas Ternisien <nicolas.ternisien@gmail.com>
For more informations, please also see the KsystemLog Web site :
http://annivernet.free.fr/ksystemlog/
Basic Installation
===================================================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Type `make install' to install the programs and any data files and
documentation.
4. You can remove the program binaries and object files from the
source code directory by typing `make clean'.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

@ -0,0 +1,22 @@
SUBDIRS = $(TOPSUBDIRS)
$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
$(top_srcdir)/subdirs:
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
package-messages:
cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
$(MAKE) -C po merge
EXTRA_DIST = admin COPYING configure.in.in
dist-hook:
cd $(top_distdir) && perl admin/am_edit -padmin
cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs

@ -0,0 +1,10 @@
all:
@echo "This Makefile is only for the CVS repository"
@echo "This will be deleted before making the distribution"
@echo ""
$(MAKE) -f admin/Makefile.common cvs
dist:
$(MAKE) -f admin/Makefile.common dist
.SILENT:

16
NEWS

@ -0,0 +1,16 @@
----------------------------------
KSystemLog News
----------------------------------
Please see the news of KSystemLog online at :
http://localhost.localdomain/ksystemlog/index.php#news
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

@ -0,0 +1,14 @@
----------------------------------
KSystemLog Readme
----------------------------------
Please see the official KSystemLog Web site online at :
http://localhost.localdomain/ksystemlog/
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

15
TODO

@ -0,0 +1,15 @@
----------------------------------
KSystemLog TODO List
----------------------------------
Please see the changelog of KSystemLog online at :
http://annivernet.free.fr/ksystemlog/ideas.php
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

File diff suppressed because it is too large Load Diff

12065
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

@ -0,0 +1,219 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define if you have the CoreAudio API */
#undef HAVE_COREAUDIO
/* Define to 1 if you have the <crt_externs.h> header file. */
#undef HAVE_CRT_EXTERNS_H
/* Defines if your system has the crypt function */
#undef HAVE_CRYPT
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have libjpeg */
#undef HAVE_LIBJPEG
/* Define if you have libpng */
#undef HAVE_LIBPNG
/* Define if you have a working libpthread (will enable threaded code) */
#undef HAVE_LIBPTHREAD
/* Define if you have libz */
#undef HAVE_LIBZ
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if your system needs _NSGetEnviron to set up the environment */
#undef HAVE_NSGETENVIRON
/* Define if you have the res_init function */
#undef HAVE_RES_INIT
/* Define if you have a STL implementation by SGI */
#undef HAVE_SGI_STL
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have strlcat */
#undef HAVE_STRLCAT
/* Define if you have the strlcat prototype */
#undef HAVE_STRLCAT_PROTO
/* Define if you have strlcpy */
#undef HAVE_STRLCPY
/* Define if you have the strlcpy prototype */
#undef HAVE_STRLCPY_PROTO
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Suffix for lib directories */
#undef KDELIBSUFF
/* Define a safe value for MAXPATHLEN */
#undef KDEMAXPATHLEN
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of a `char *', as computed by sizeof. */
#undef SIZEOF_CHAR_P
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of a `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
/* The size of a `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/*
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
* headers and I'm too lazy to write a configure test as long as only
* unixware is related
*/
#ifdef _UNIXWARE
#define HAVE_BOOLEAN
#endif
/*
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
* that defines bzero.
*/
#if defined(_AIX)
#include <strings.h>
#endif
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
# include <sys/time.h>
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
#endif
#if !defined(HAVE_STRLCAT_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
unsigned long strlcat(char*, const char*, unsigned long);
#ifdef __cplusplus
}
#endif
#endif
#if !defined(HAVE_STRLCPY_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
unsigned long strlcpy(char*, const char*, unsigned long);
#ifdef __cplusplus
}
#endif
#endif
/*
* On HP-UX, the declaration of vsnprintf() is needed every time !
*/
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
#if __STDC__
#include <stdarg.h>
#include <stdlib.h>
#else
#include <varargs.h>
#endif
#ifdef __cplusplus
extern "C"
#endif
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
#ifdef __cplusplus
extern "C"
#endif
int snprintf(char *str, size_t n, char const *fmt, ...);
#endif
#if defined(__SVR4) && !defined(__svr4__)
#define __svr4__ 1
#endif
/* Compatibility define */
#undef ksize_t
/* Define the real type of socklen_t */
#undef socklen_t

@ -0,0 +1,2 @@
./admin/configure.in.min
configure.in.in

@ -0,0 +1,95 @@
dnl This file is part of the KDE libraries/packages
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
dnl This file is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
dnl License as published by the Free Software Foundation; either
dnl version 2 of the License, or (at your option) any later version.
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Library General Public License for more details.
dnl You should have received a copy of the GNU Library General Public License
dnl along with this library; see the file COPYING.LIB. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl Boston, MA 02110-1301, USA.
# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas
dnl Process this file with autoconf to produce a configure script.
AC_INIT(acinclude.m4) dnl a source file from your sub dir
dnl This is so we can use kde-common
AC_CONFIG_AUX_DIR(admin)
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH
dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM
dnl Perform program name transformation
AC_ARG_PROGRAM
dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(ksystemlog, 0.1) dnl searches for some needed programs
KDE_SET_PREFIX
dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
dnl Checks for programs.
AC_CHECK_COMPILERS
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL
dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files
AM_KDE_WITH_NLS
KDE_USE_QT(3.2.0)
AC_PATH_KDE
#MIN_CONFIG(3.2.0)
dnl PACKAGE set before
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN
KDE_CREATE_SUBDIRSLIST
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ ksystemlog/Makefile ])
AC_CONFIG_FILES([ ksystemlog/doc/Makefile ])
AC_CONFIG_FILES([ ksystemlog/doc/en/Makefile ])
AC_CONFIG_FILES([ ksystemlog/po/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/acpid/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/apache/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/bootauth/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/config/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/cron/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/cups/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/daemon/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/kernel/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/postfix/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/samba/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/system/Makefile ])
AC_CONFIG_FILES([ ksystemlog/src/xorg/Makefile ])
AC_OUTPUT
if test "$all_tests" = "bad"; then
if test ! "$cache_file" = "/dev/null"; then
echo ""
echo "Please remove the file $cache_file after changing your setup"
echo "so that configure will find the changes next time."
echo ""
fi
else
echo ""
echo "Good - your configure finished. Start make now"
echo ""
fi

@ -0,0 +1,6 @@
#MIN_CONFIG(3.2.0)
AM_INIT_AUTOMAKE(ksystemlog, 0.1)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN

@ -0,0 +1,229 @@
<?xml version = '1.0'?>
<kdevelop>
<general>
<author>Nicolas Ternisien</author>
<email>nicolas.ternisien@gmail.com</email>
<version>0.3.2</version>
<projectmanagement>KDevKDEAutoProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
<keywords>
<keyword>C++</keyword>
<keyword>Code</keyword>
<keyword>Qt</keyword>
<keyword>KDE</keyword>
</keywords>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<ignoreparts>
<part>kdevfileview</part>
<part>kdevscripting</part>
<part>kdevfilter</part>
<part>kdevdoxygen</part>
<part>kdevbookmarks</part>
<part>kdevdistpart</part>
<part>kdevfilegroups</part>
<part>kdevctags2</part>
<part>kdevgrepview</part>
<part>kdevkonsoleview</part>
<part>kdevsnippet</part>
<part>kdevreplace</part>
<part>kdevpartexplorer</part>
</ignoreparts>
<versioncontrol/>
</general>
<kdevautoproject>
<general>
<activetarget>ksystemlog/src/ksystemlog</activetarget>
<useconfiguration>debug</useconfiguration>
</general>
<run>
<mainprogram>ksystemlog/src/ksystemlog</mainprogram>
<terminal>false</terminal>
<directoryradio>executable</directoryradio>
<runarguments>
<ksystemlog/>
</runarguments>
<customdirectory>/</customdirectory>
<programargs/>
<autocompile>true</autocompile>
<envvars/>
</run>
<make>
<envvars>
<envvar value="1" name="WANT_AUTOCONF_2_5" />
<envvar value="1" name="WANT_AUTOMAKE_1_6" />
</envvars>
<abortonerror>false</abortonerror>
<numberofjobs>1</numberofjobs>
<dontact>false</dontact>
<makebin/>
<prio>0</prio>
</make>
<configurations>
<optimized>
<builddir>optimized</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O2 -g0</cxxflags>
</optimized>
<debug>
<configargs>--enable-debug=full</configargs>
<builddir>debug</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O0 -g3</cxxflags>
<envvars/>
</debug>
</configurations>
</kdevautoproject>
<kdevfileview>
<groups>
<group pattern="*.cpp;*.cxx;*.h" name="Sources" />
<group pattern="*.ui" name="User Interface" />
<group pattern="*.png" name="Icons" />
<group pattern="*.po;*.ts" name="Translations" />
<group pattern="*" name="Others" />
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<tree>
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
<showvcsfields>false</showvcsfields>
</tree>
</kdevfileview>
<kdevdoctreeview>
<ignoretocs>
<toc>ada</toc>
<toc>ada_bugs_gcc</toc>
<toc>bash</toc>
<toc>bash_bugs</toc>
<toc>clanlib</toc>
<toc>w3c-dom-level2-html</toc>
<toc>fortran_bugs_gcc</toc>
<toc>gnome1</toc>
<toc>gnustep</toc>
<toc>gtk</toc>
<toc>gtk_bugs</toc>
<toc>haskell</toc>
<toc>haskell_bugs_ghc</toc>
<toc>java_bugs_gcc</toc>
<toc>java_bugs_sun</toc>
<toc>pascal_bugs_fp</toc>
<toc>php</toc>
<toc>php_bugs</toc>
<toc>perl</toc>
<toc>perl_bugs</toc>
<toc>python</toc>
<toc>python_bugs</toc>
<toc>ruby</toc>
<toc>ruby_bugs</toc>
<toc>sdl</toc>
<toc>w3c-svg</toc>
<toc>sw</toc>
<toc>w3c-uaag10</toc>
<toc>wxwidgets_bugs</toc>
</ignoretocs>
<ignoreqt_xml>
<toc>qmake User Guide</toc>
</ignoreqt_xml>
</kdevdoctreeview>
<kdevdebugger>
<general>
<dbgshell>libtool</dbgshell>
<programargs/>
<gdbpath/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
<runappinappdirectory>true</runappinappdirectory>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
</general>
<display>
<staticmembers>false</staticmembers>
<demanglenames>true</demanglenames>
<outputradix>10</outputradix>
</display>
</kdevdebugger>
<kdevfilecreate>
<filetypes/>
<useglobaltypes>
<type ext="ui" />
<type ext="cpp" />
<type ext="h" />
</useglobaltypes>
</kdevfilecreate>
<kdevcvs>
<cvsoptions>-f</cvsoptions>
<commitoptions/>
<updateoptions>-dP</updateoptions>
<addoptions/>
<removeoptions>-f</removeoptions>
<diffoptions>-u3 -p</diffoptions>
<logoptions/>
<rshoptions/>
</kdevcvs>
<cppsupportpart>
<codecompletion/>
<filetemplates>
<choosefiles>false</choosefiles>
<interfaceURL/>
<implementationURL/>
<interfacesuffix>.h</interfacesuffix>
<implementationsuffix>.cpp</implementationsuffix>
<lowercasefilenames>true</lowercasefilenames>
</filetemplates>
</cppsupportpart>
<kdevclassview>
<folderhierarchy>true</folderhierarchy>
<depthoffolders>2</depthoffolders>
</kdevclassview>
<kdevdocumentation>
<projectdoc>
<docsystem>Collection de documentation Doxygen</docsystem>
<docurl>ksystemlog.tag</docurl>
<usermanualurl/>
</projectdoc>
</kdevdocumentation>
<substmap>
<APPNAME>ksystemlog</APPNAME>
<APPNAMELC>ksystemlog</APPNAMELC>
<APPNAMESC>Ksystemlog</APPNAMESC>
<APPNAMEUC>KSYSTEMLOG</APPNAMEUC>
<AUTHOR>Nicolas Ternisien</AUTHOR>
<EMAIL>nicolast@libertysurf.fr</EMAIL>
<LICENSE>GPL</LICENSE>
<LICENSEFILE>COPYING</LICENSEFILE>
<VERSION>0.1</VERSION>
<YEAR>2005</YEAR>
<dest>/mnt/boulot/devel/ksystemlog</dest>
</substmap>
<kdevcppsupport>
<references/>
<codecompletion>
<includeGlobalFunctions>true</includeGlobalFunctions>
<includeTypes>true</includeTypes>
<includeEnums>true</includeEnums>
<includeTypedefs>false</includeTypedefs>
<automaticCodeCompletion>true</automaticCodeCompletion>
<automaticArgumentsHint>true</automaticArgumentsHint>
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<codeCompletionDelay>250</codeCompletionDelay>
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
<creategettersetter>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
<inlineGet>true</inlineGet>
<inlineSet>true</inlineSet>
</creategettersetter>
</kdevcppsupport>
</kdevelop>

Binary file not shown.

@ -0,0 +1,139 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="40" >
<Doc0 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/detailDialog.cpp" >
<View0 Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/detailDialog.h" >
<View0 line="47" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/globals.h" >
<View0 line="33" Type="Source" />
</Doc2>
<Doc3 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/globals.cpp" >
<View0 line="0" Type="Source" />
</Doc3>
<Doc4 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/ksystemlog.cpp" >
<View0 line="117" Type="Source" />
</Doc4>
<Doc5 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/ksystemlog.h" >
<View0 line="157" Type="Source" />
</Doc5>
<Doc6 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/Makefile.am" >
<View0 line="52" Type="Source" />
</Doc6>
<Doc7 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/xorg/xorgReader.cpp" >
<View0 line="69" Type="Source" />
</Doc7>
<Doc8 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/xorg/xorgReader.h" >
<View0 line="41" Type="Source" />
</Doc8>
<Doc9 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/system/systemReader.cpp" >
<View0 line="24" Type="Source" />
</Doc9>
<Doc10 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/samba/sambaReader.cpp" >
<View0 line="0" Type="Source" />
</Doc10>
<Doc11 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/postfix/postfixOptions.cpp" >
<View0 line="41" Type="Source" />
</Doc11>
<Doc12 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/cups/cupsReader.cpp" >
<View0 line="34" Type="Source" />
</Doc12>
<Doc13 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/cups/cupsAccessReader.cpp" >
<View0 line="73" Type="Source" />
</Doc13>
<Doc14 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/cron/cronReader.cpp" >
<View0 line="33" Type="Source" />
</Doc14>
<Doc15 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/bootauth/bootAuthenticationOptions.cpp" >
<View0 line="113" Type="Source" />
</Doc15>
<Doc16 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/apache/apacheReader.cpp" >
<View0 line="116" Type="Source" />
</Doc16>
<Doc17 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/acpid/acpidReader.cpp" >
<View0 line="29" Type="Source" />
</Doc17>
<Doc18 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/view.h" >
<View0 line="61" Type="Source" />
</Doc18>
<Doc19 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/view.cpp" >
<View0 line="33" Type="Source" />
</Doc19>
<Doc20 NumberOfViews="1" URL="file:///usr/share/doc/HTML/en/kdelibs-apidocs/kdeui/html/classKListViewItem.html" >
<View0 Type="Documentation" />
</Doc20>
<Doc21 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/apache/apacheReader.h" >
<View0 line="0" Type="Source" />
</Doc21>
<Doc22 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/web/changelog.php" >
<View0 line="42" Type="Source" />
</Doc22>
<Doc23 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/web/ideas.php" >
<View0 line="30" Type="Source" />
</Doc23>
<Doc24 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/itemFactory.h" >
<View0 line="76" Type="Source" />
</Doc24>
<Doc25 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/itemFactory.cpp" >
<View0 line="494" Type="Source" />
</Doc25>
<Doc26 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/apache/apacheAccessReader.cpp" >
<View0 line="94" Type="Source" />
</Doc26>
<Doc27 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/parsingHelper.cpp" >
<View0 line="86" Type="Source" />
</Doc27>
<Doc28 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/slotLogAction.cpp" >
<View0 line="52" Type="Source" />
</Doc28>
<Doc29 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/main.cpp" >
<View0 line="0" Type="Source" />
</Doc29>
<Doc30 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/options.h" >
<View0 line="0" Type="Source" />
</Doc30>
<Doc31 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/viewToolTip.h" >
<View0 line="0" Type="Source" />
</Doc31>
<Doc32 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/specificFileList.h" >
<View0 line="0" Type="Source" />
</Doc32>
<Doc33 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/specificFileList.cpp" >
<View0 line="0" Type="Source" />
</Doc33>
<Doc34 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/logViewColumn.h" >
<View0 line="21" Type="Source" />
</Doc34>
<Doc35 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/logMode.h" >
<View0 line="63" Type="Source" />
</Doc35>
<Doc36 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/logManager.h" >
<View0 line="183" Type="Source" />
</Doc36>
<Doc37 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/logListItem.h" >
<View0 line="8" Type="Source" />
</Doc37>
<Doc38 NumberOfViews="1" URL="file:///mnt/boulot/devel/playground/sysadmin/ksystemlog/src/logManager.cpp" >
<View0 line="246" Type="Source" />
</Doc38>
<Doc39 NumberOfViews="1" URL="file:///usr/share/doc/HTML/en/kdelibs-apidocs/kdeui/html/classKAction.html" >
<View0 Type="Documentation" />
</Doc39>
</DocsAndViews>
<pluginList>
<kdevdebugger>
<breakpointList>
<breakpoint0 location="/mnt/boulot/devel/ksystemlog/src/samba/sambaReader.cpp:115" type="1" condition="" enabled="1" />
</breakpointList>
</kdevdebugger>
<kdevvalgrind>
<executable path="" params="" />
<valgrind path="/usr/bin/valgrind" params="--tool=memcheck --leak-check=yes" />
<calltree path="calltree" params=" --trace-children=yes" />
<kcachegrind path="/usr/bin/kcachegrind" />
</kdevvalgrind>
</pluginList>
</KDevPrjSession>

@ -0,0 +1,3 @@
Nicolas Ternisien <nicolas.ternisien@gmail.com>
Please see http://annivernet.free.fr/ksystemlog/ for more informations.

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -0,0 +1,16 @@
----------------------------------
KSystemLog Changelog
----------------------------------
Please see the changelog of KSystemLog online at :
http://annivernet.free.fr/ksystemlog/changelog.php
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

@ -0,0 +1,181 @@
Specific Trouble case with KSystemLog
===================================================
I hope that you will don't have any problems to compile and test KSystemLog.
If you successfully compile KSystemLog but you have strange problems (with the
tool bars, please manually copy src/ksystemlogui.rc in the $HOME/.kde/share/apps/ksystemlog
folder (create it if it does not exist).
If you still have problems, do not hesitate do email me ;-)
Nicolas Ternisien <nicolas.ternisien@gmail.com>
For more informations, please also see the KsystemLog Web site :
http://annivernet.free.fr/ksystemlog/
Basic Installation
===================================================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Type `make install' to install the programs and any data files and
documentation.
4. You can remove the program binaries and object files from the
source code directory by typing `make clean'.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

@ -0,0 +1 @@
SUBDIRS = src

@ -0,0 +1,16 @@
----------------------------------
KSystemLog News
----------------------------------
Please see the news of KSystemLog online at :
http://localhost.localdomain/ksystemlog/index.php#news
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

@ -0,0 +1,14 @@
----------------------------------
KSystemLog Readme
----------------------------------
Please see the official KSystemLog Web site online at :
http://localhost.localdomain/ksystemlog/
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

@ -0,0 +1,15 @@
----------------------------------
KSystemLog TODO List
----------------------------------
Please see the changelog of KSystemLog online at :
http://annivernet.free.fr/ksystemlog/ideas.php
Thank you.
For any information and/or improvements, do not hesitate to send a mail to :
Nicolas Ternisien <nicolas.ternisien@gmail.com>
KSystemLog Web site :
http://annivernet.free.fr/ksystemlog/

@ -0,0 +1,646 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# KDE tags expanded automatically by am_edit - $Revision: 1.7 $
# ksystemlog/doc/Makefile. Generated from Makefile.in by config.pl.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# the SUBDIRS is filled automatically by am_edit. If files are
# in this directory they are installed into the english dir
srcdir = .
top_srcdir = ../..
VPATH = .
pkgdatadir = $(datadir)/ksystemlog
pkglibdir = $(libdir)/ksystemlog
pkgincludedir = $(includedir)/ksystemlog
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c -p
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
target_triplet = i686-pc-linux-gnu
ACLOCAL = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run aclocal-1.7
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run tar
AR = ar
ARTSCCONFIG = /usr/bin/artsc-config
AUTOCONF = $(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure
AUTODIRS =
AUTOHEADER = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run autoheader
AUTOMAKE = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run automake-1.7
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -O2 -Wformat-security -Wmissing-format-attribute
CONF_FILES = $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
CPP = gcc -E
CPPFLAGS = -DQT_THREAD_SUPPORT -D_REENTRANT
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common
CYGPATH_W = echo
DCOPIDL = /usr/bin/dcopidl
DCOPIDL2CPP = /usr/bin/dcopidl2cpp
DCOPIDLNG = /usr/bin/dcopidlng
DCOP_DEPENDENCIES = $(DCOPIDL) $(DCOPIDLNG)
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EXEEXT =
F77 =
FFLAGS =
FRAMEWORK_COREAUDIO =
GMSGFMT = /usr/bin/msgfmt
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG)
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
KCFG_DEPENDENCIES = $(KCONFIG_COMPILER)
KCONFIG_COMPILER = /usr/bin/kconfig_compiler
KDECONFIG = /usr/bin/kde-config
KDE_EXTRA_RPATH =
KDE_INCLUDES = -I/usr/include/kde
KDE_LDFLAGS = -L/usr/lib
KDE_MT_LDFLAGS =
KDE_MT_LIBS = -lpthread
KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
KDE_PLUGIN = -avoid-version -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
KDE_RPATH = -R $(kde_libraries) -R $(qt_libraries) -R $(x_libraries)
KDE_USE_CLOSURE_FALSE =
KDE_USE_CLOSURE_TRUE = #
KDE_USE_FINAL_FALSE =
KDE_USE_FINAL_TRUE = #
KDE_USE_NMCHECK_FALSE =
KDE_USE_NMCHECK_TRUE = #
KDE_XSL_STYLESHEET = /usr/share/apps/ksgmltools2/customization/kde-chunk.xsl
LDFLAGS =
LIBCOMPAT =
LIBCRYPT = -lcrypt
LIBDL = -ldl
LIBJPEG = -ljpeg
LIBOBJS =
LIBPNG = -lpng -lz -lm
LIBPTHREAD = -lpthread
LIBRESOLV = -lresolv
LIBS =
LIBSM = -lSM -lICE
LIBSOCKET =
LIBTOOL = $(SHELL) $(top_builddir)/libtool --silent
LIBUCB =
LIBUTIL = -lutil
LIBZ = -lz
LIB_KAB = -lkab
LIB_KABC = -lkabc
LIB_KDECORE = -lkdecore
LIB_KDEPIM = -lkdepim
LIB_KDEPRINT = -lkdeprint
LIB_KDEUI = -lkdeui
LIB_KFILE = -lkio
LIB_KFM =
LIB_KHTML = -lkhtml
LIB_KIO = -lkio
LIB_KPARTS = -lkparts
LIB_KSPELL = -lkspell
LIB_KSYCOCA = -lkio
LIB_KUTILS = -lkutils
LIB_POLL =
LIB_QPE =
LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread
LIB_SMB = -lsmb
LIB_X11 = -lX11 $(LIBSOCKET)
LIB_XEXT = -lXext
LIB_XRENDER =
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run makeinfo
MCOPIDL = /usr/bin/mcopidl
MEINPROC = /usr/bin/meinproc
MOC = /usr/share/qt3/bin/moc
MSGFMT = /usr/bin/msgfmt
NOOPT_CFLAGS = -O0
NOOPT_CXXFLAGS = -O0
OBJEXT = o
PACKAGE = ksystemlog
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_VERSION =
PATH_SEPARATOR = :
PERL = /usr/bin/perl
QTE_NORTTI =
QT_INCLUDES = -I/usr/share/qt3/include
QT_LDFLAGS = -L/usr/share/qt3/lib
RANLIB = ranlib
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
TOPSUBDIRS = ksystemlog
UIC = /usr/share/qt3/bin/uic -L $(kde_widgetdir) -nounload
UIC_TR = tr2i18n
USER_INCLUDES =
USER_LDFLAGS =
USE_EXCEPTIONS = -fexceptions
USE_RTTI =
USE_THREADS =
VERSION = 0.1
WOVERLOADED_VIRTUAL =
XGETTEXT = /usr/bin/xgettext
XMLLINT = /usr/bin/xmllint
X_EXTRA_LIBS =
X_INCLUDES = -I.
X_LDFLAGS = -L/usr/lib
X_PRE_LIBS =
X_RPATH = -R $(x_libraries)
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_F77 =
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
all_includes = -I/usr/include/kde -I/usr/share/qt3/include -I.
all_libraries = -L/usr/lib -L/usr/share/qt3/lib
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = pc
datadir = ${prefix}/share
exec_prefix = ${prefix}
host = i686-pc-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = pc
include_ARTS_FALSE = #
include_ARTS_TRUE =
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /root/ksystemlog/ksystemlog-0.3.2/admin/install-sh
kde_appsdir = ${datadir}/applnk
kde_bindir = ${exec_prefix}/bin
kde_confdir = ${datadir}/config
kde_datadir = ${datadir}/apps
kde_htmldir = ${datadir}/doc/HTML
kde_icondir = ${datadir}/icons
kde_includes = /usr/include/kde
kde_kcfgdir = ${datadir}/config.kcfg
kde_libraries = /usr/lib
kde_libs_htmldir = /usr/share/doc/kde/HTML
kde_libs_prefix = /usr
kde_locale = ${datadir}/locale
kde_mimedir = ${datadir}/mimelnk
kde_moduledir = ${libdir}/kde3
kde_qtver = 3
kde_servicesdir = ${datadir}/services
kde_servicetypesdir = ${datadir}/servicetypes
kde_sounddir = ${datadir}/sounds
kde_styledir = ${libdir}/kde3/plugins/styles
kde_templatesdir = ${datadir}/templates
kde_wallpaperdir = ${datadir}/wallpapers
kde_widgetdir = /usr/lib/kde3/plugins/designer
kdeinitdir = $(kde_moduledir)
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
mandir = ${prefix}/man
oldincludedir = /usr/include
prefix = /usr
program_transform_name = s,x,x,
qt_includes = /usr/share/qt3/include
qt_libraries = /usr/share/qt3/lib
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target = i686-pc-linux-gnu
target_alias =
target_cpu = i686
target_os = linux-gnu
target_vendor = pc
x_includes = .
x_libraries = /usr/lib
xdg_appsdir = ${datadir}/applications/kde
xdg_directorydir = ${datadir}/desktop-directories
xdg_menudir = ${sysconfdir}/xdg/menus
KDE_LANG = en
KDE_DOCS = ksystemlog
#>- SUBDIRS = $(AUTODIRS)
#>+ 1
SUBDIRS =. en
subdir = ksystemlog/doc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
#>- RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
#>- ps-recursive install-info-recursive uninstall-info-recursive \
#>- all-recursive install-data-recursive install-exec-recursive \
#>- installdirs-recursive install-recursive uninstall-recursive \
#>- check-recursive installcheck-recursive
#>+ 5
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
ps-recursive install-info-recursive uninstall-info-recursive \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive nmcheck-recursive bcheck-recursive
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
DIST_SUBDIRS = $(SUBDIRS)
#>- all: all-recursive
#>+ 1
all: docs-am all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
#>- cd $(top_srcdir) && \
#>- $(AUTOMAKE) --gnu ksystemlog/doc/Makefile
#>+ 3
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ksystemlog/doc/Makefile
cd $(top_srcdir) && perl admin/am_edit ksystemlog/doc/Makefile.in
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
else \
include_option=--include; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
#>+ 1
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
#>- clean: clean-recursive
#>+ 1
clean: kde-rpo-clean clean-recursive
#>- clean-am: clean-generic clean-libtool mostlyclean-am
#>+ 1
clean-am: clean-bcheck clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-libtool clean-recursive ctags \
ctags-recursive distclean distclean-generic distclean-libtool \
distclean-recursive distclean-tags distdir dvi dvi-am \
dvi-recursive info info-am info-recursive install install-am \
install-data install-data-am install-data-recursive \
install-exec install-exec-am install-exec-recursive \
install-info install-info-am install-info-recursive install-man \
install-recursive install-strip installcheck installcheck-am \
installdirs installdirs-am installdirs-recursive \
maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
#>+ 2
KDE_DIST=Makefile.in
#>+ 2
docs-am:
#>+ 6
force-reedit:
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ksystemlog/doc/Makefile
cd $(top_srcdir) && perl admin/am_edit ksystemlog/doc/Makefile.in
#>+ 21
clean-bcheck:
rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
bcheck: bcheck-recursive
bcheck-am:
@for i in ; do \
if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
echo "$$i"; \
if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
rm -f $$i.bchecktest.cc; exit 1; \
fi ; \
echo "" >> $$i.bchecktest.cc.class; \
perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
rm -f a.out; \
fi ; \
done
#>+ 3
final:
$(MAKE) all-am
#>+ 3
final-install:
$(MAKE) install-am
#>+ 3
no-final:
$(MAKE) all-am
#>+ 3
no-final-install:
$(MAKE) install-am
#>+ 3
cvs-clean:
$(MAKE) admindir=$(top_srcdir)/admin -f $(top_srcdir)/admin/Makefile.common cvs-clean
#>+ 3
kde-rpo-clean:
-rm -f *.rpo
#>+ 3
nmcheck:
nmcheck-am: nmcheck

@ -0,0 +1,6 @@
# the SUBDIRS is filled automatically by am_edit. If files are
# in this directory they are installed into the english dir
KDE_LANG = en
KDE_DOCS = ksystemlog
SUBDIRS = $(AUTODIRS)

@ -0,0 +1,532 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# KDE tags expanded automatically by am_edit - $Revision: 1.7 $
# ksystemlog/doc/en/Makefile. Generated from Makefile.in by config.pl.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
srcdir = .
top_srcdir = ../../..
VPATH = .
pkgdatadir = $(datadir)/ksystemlog
pkglibdir = $(libdir)/ksystemlog
pkgincludedir = $(includedir)/ksystemlog
top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c -p
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
target_triplet = i686-pc-linux-gnu
ACLOCAL = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run aclocal-1.7
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run tar
AR = ar
ARTSCCONFIG = /usr/bin/artsc-config
AUTOCONF = $(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure
AUTODIRS =
AUTOHEADER = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run autoheader
AUTOMAKE = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run automake-1.7
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -O2 -Wformat-security -Wmissing-format-attribute
CONF_FILES = $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
CPP = gcc -E
CPPFLAGS = -DQT_THREAD_SUPPORT -D_REENTRANT
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common
CYGPATH_W = echo
DCOPIDL = /usr/bin/dcopidl
DCOPIDL2CPP = /usr/bin/dcopidl2cpp
DCOPIDLNG = /usr/bin/dcopidlng
DCOP_DEPENDENCIES = $(DCOPIDL) $(DCOPIDLNG)
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EXEEXT =
F77 =
FFLAGS =
FRAMEWORK_COREAUDIO =
GMSGFMT = /usr/bin/msgfmt
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG)
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
KCFG_DEPENDENCIES = $(KCONFIG_COMPILER)
KCONFIG_COMPILER = /usr/bin/kconfig_compiler
KDECONFIG = /usr/bin/kde-config
KDE_EXTRA_RPATH =
KDE_INCLUDES = -I/usr/include/kde
KDE_LDFLAGS = -L/usr/lib
KDE_MT_LDFLAGS =
KDE_MT_LIBS = -lpthread
KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
KDE_PLUGIN = -avoid-version -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
KDE_RPATH = -R $(kde_libraries) -R $(qt_libraries) -R $(x_libraries)
KDE_USE_CLOSURE_FALSE =
KDE_USE_CLOSURE_TRUE = #
KDE_USE_FINAL_FALSE =
KDE_USE_FINAL_TRUE = #
KDE_USE_NMCHECK_FALSE =
KDE_USE_NMCHECK_TRUE = #
KDE_XSL_STYLESHEET = /usr/share/apps/ksgmltools2/customization/kde-chunk.xsl
LDFLAGS =
LIBCOMPAT =
LIBCRYPT = -lcrypt
LIBDL = -ldl
LIBJPEG = -ljpeg
LIBOBJS =
LIBPNG = -lpng -lz -lm
LIBPTHREAD = -lpthread
LIBRESOLV = -lresolv
LIBS =
LIBSM = -lSM -lICE
LIBSOCKET =
LIBTOOL = $(SHELL) $(top_builddir)/libtool --silent
LIBUCB =
LIBUTIL = -lutil
LIBZ = -lz
LIB_KAB = -lkab
LIB_KABC = -lkabc
LIB_KDECORE = -lkdecore
LIB_KDEPIM = -lkdepim
LIB_KDEPRINT = -lkdeprint
LIB_KDEUI = -lkdeui
LIB_KFILE = -lkio
LIB_KFM =
LIB_KHTML = -lkhtml
LIB_KIO = -lkio
LIB_KPARTS = -lkparts
LIB_KSPELL = -lkspell
LIB_KSYCOCA = -lkio
LIB_KUTILS = -lkutils
LIB_POLL =
LIB_QPE =
LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread
LIB_SMB = -lsmb
LIB_X11 = -lX11 $(LIBSOCKET)
LIB_XEXT = -lXext
LIB_XRENDER =
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run makeinfo
MCOPIDL = /usr/bin/mcopidl
MEINPROC = /usr/bin/meinproc
MOC = /usr/share/qt3/bin/moc
MSGFMT = /usr/bin/msgfmt
NOOPT_CFLAGS = -O0
NOOPT_CXXFLAGS = -O0
OBJEXT = o
PACKAGE = ksystemlog
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_VERSION =
PATH_SEPARATOR = :
PERL = /usr/bin/perl
QTE_NORTTI =
QT_INCLUDES = -I/usr/share/qt3/include
QT_LDFLAGS = -L/usr/share/qt3/lib
RANLIB = ranlib
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
TOPSUBDIRS = ksystemlog
UIC = /usr/share/qt3/bin/uic -L $(kde_widgetdir) -nounload
UIC_TR = tr2i18n
USER_INCLUDES =
USER_LDFLAGS =
USE_EXCEPTIONS = -fexceptions
USE_RTTI =
USE_THREADS =
VERSION = 0.1
WOVERLOADED_VIRTUAL =
XGETTEXT = /usr/bin/xgettext
XMLLINT = /usr/bin/xmllint
X_EXTRA_LIBS =
X_INCLUDES = -I.
X_LDFLAGS = -L/usr/lib
X_PRE_LIBS =
X_RPATH = -R $(x_libraries)
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_F77 =
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
all_includes = -I/usr/include/kde -I/usr/share/qt3/include -I.
all_libraries = -L/usr/lib -L/usr/share/qt3/lib
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = pc
datadir = ${prefix}/share
exec_prefix = ${prefix}
host = i686-pc-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = pc
include_ARTS_FALSE = #
include_ARTS_TRUE =
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /root/ksystemlog/ksystemlog-0.3.2/admin/install-sh
kde_appsdir = ${datadir}/applnk
kde_bindir = ${exec_prefix}/bin
kde_confdir = ${datadir}/config
kde_datadir = ${datadir}/apps
kde_htmldir = ${datadir}/doc/HTML
kde_icondir = ${datadir}/icons
kde_includes = /usr/include/kde
kde_kcfgdir = ${datadir}/config.kcfg
kde_libraries = /usr/lib
kde_libs_htmldir = /usr/share/doc/kde/HTML
kde_libs_prefix = /usr
kde_locale = ${datadir}/locale
kde_mimedir = ${datadir}/mimelnk
kde_moduledir = ${libdir}/kde3
kde_qtver = 3
kde_servicesdir = ${datadir}/services
kde_servicetypesdir = ${datadir}/servicetypes
kde_sounddir = ${datadir}/sounds
kde_styledir = ${libdir}/kde3/plugins/styles
kde_templatesdir = ${datadir}/templates
kde_wallpaperdir = ${datadir}/wallpapers
kde_widgetdir = /usr/lib/kde3/plugins/designer
kdeinitdir = $(kde_moduledir)
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
mandir = ${prefix}/man
oldincludedir = /usr/include
prefix = /usr
program_transform_name = s,x,x,
qt_includes = /usr/share/qt3/include
qt_libraries = /usr/share/qt3/lib
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target = i686-pc-linux-gnu
target_alias =
target_cpu = i686
target_os = linux-gnu
target_vendor = pc
x_includes = .
x_libraries = /usr/lib
xdg_appsdir = ${datadir}/applications/kde
xdg_directorydir = ${datadir}/desktop-directories
xdg_menudir = ${sysconfdir}/xdg/menus
KDE_DOCS = ksystemlog
KDE_LANG = en
subdir = ksystemlog/doc/en
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
#>- all: all-am
#>+ 1
all: docs-am all-am
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
#>- cd $(top_srcdir) && \
#>- $(AUTOMAKE) --gnu ksystemlog/doc/en/Makefile
#>+ 3
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ksystemlog/doc/en/Makefile
cd $(top_srcdir) && perl admin/am_edit ksystemlog/doc/en/Makefile.in
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
#>+ 1
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
top_distdir = ../../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
#>- distdir: $(DISTFILES)
#>+ 1
distdir: distdir-nls $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
#>- uninstall: uninstall-am
#>+ 1
uninstall: uninstall-docs uninstall-nls uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
#>- clean: clean-am
#>+ 1
clean: kde-rpo-clean clean-am
#>- clean-am: clean-generic clean-libtool mostlyclean-am
#>+ 1
clean-am: clean-docs clean-bcheck clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
info: info-am
info-am:
#>- install-data-am:
#>+ 1
install-data-am: install-docs install-nls
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
#>+ 2
KDE_DIST=Makefile.in index.docbook
#>+ 24
index.cache.bz2: $(srcdir)/index.docbook $(KDE_XSL_STYLESHEET) index.docbook
@if test -n "$(MEINPROC)"; then echo $(MEINPROC) --check --cache index.cache.bz2 $(srcdir)/index.docbook; $(MEINPROC) --check --cache index.cache.bz2 $(srcdir)/index.docbook; fi
docs-am: index.cache.bz2
install-docs: docs-am install-nls
$(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog
@if test -f index.cache.bz2; then \
echo $(INSTALL_DATA) index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/; \
$(INSTALL_DATA) index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/; \
elif test -f $(srcdir)/index.cache.bz2; then \
echo $(INSTALL_DATA) $(srcdir)/index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/; \
$(INSTALL_DATA) $(srcdir)/index.cache.bz2 $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/; \
fi
-rm -f $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/common
$(LN_S) $(kde_libs_htmldir)/$(KDE_LANG)/common $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/common
uninstall-docs:
-rm -rf $(kde_htmldir)/$(KDE_LANG)/ksystemlog
clean-docs:
-rm -f index.cache.bz2
#>+ 13
install-nls:
$(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog
@for base in index.docbook ; do \
echo $(INSTALL_DATA) $$base $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/$$base ;\
$(INSTALL_DATA) $(srcdir)/$$base $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/$$base ;\
done
uninstall-nls:
for base in index.docbook ; do \
rm -f $(DESTDIR)$(kde_htmldir)/$(KDE_LANG)/ksystemlog/$$base ;\
done
#>+ 5
distdir-nls:
for file in index.docbook ; do \
cp $(srcdir)/$$file $(distdir); \
done
#>+ 6
force-reedit:
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ksystemlog/doc/en/Makefile
cd $(top_srcdir) && perl admin/am_edit ksystemlog/doc/en/Makefile.in
#>+ 21
clean-bcheck:
rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
bcheck: bcheck-am
bcheck-am:
@for i in ; do \
if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
echo "$$i"; \
if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
rm -f $$i.bchecktest.cc; exit 1; \
fi ; \
echo "" >> $$i.bchecktest.cc.class; \
perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
rm -f a.out; \
fi ; \
done
#>+ 3
final:
$(MAKE) all-am
#>+ 3
final-install:
$(MAKE) install-am
#>+ 3
no-final:
$(MAKE) all-am
#>+ 3
no-final-install:
$(MAKE) install-am
#>+ 3
cvs-clean:
$(MAKE) admindir=$(top_srcdir)/admin -f $(top_srcdir)/admin/Makefile.common cvs-clean
#>+ 3
kde-rpo-clean:
-rm -f *.rpo
#>+ 3
nmcheck:
nmcheck-am: nmcheck

@ -0,0 +1,2 @@
KDE_DOCS = ksystemlog
KDE_LANG = en

@ -0,0 +1,555 @@
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!ENTITY ksystemlog "<application>ksystemlog 0.1</application>">
<!ENTITY kappname "&ksystemlog;"><!-- Do *not* replace kappname-->
<!ENTITY package "kde-module"><!-- kdebase, kdeadmin, etc -->
<!ENTITY % addindex "IGNORE">
<!ENTITY % English "INCLUDE"><!-- change language only here -->
<!-- Do not define any other entities; instead, use the entities
from kde-genent.entities and $LANG/user.entities. -->
]>
<!-- kdoctemplate v0.8 October 1 1999
Minor update to "Credits and Licenses" section on August 24, 2000
Removed "Revision history" section on 22 January 2001
Changed to Installation/Help menu entities 18 October 2001
Other minor cleanup and changes 18 October 2001 -->
<!--
This template was designed by: David Rugge davidrugge@mindspring.com
with lots of help from: Eric Bischoff ebisch@cybercable.tm.fr
and Frederik Fouvry fouvry@sfs.nphil.uni-tuebingen.de
of the KDE DocBook team.
You may freely use this template for writing any sort of KDE documentation.
If you have any changes or improvements, please let us know.
Remember:
- in XML, the case of the <tags> and attributes is relevant ;
- also, quote all attributes.
Please don't forget to remove all these comments in your final documentation,
thanks ;-).
-->
<!-- ................................................................ -->
<!-- The language must NOT be changed here. -->
<book lang="&language;">
<!-- This header contains all of the meta-information for the document such
as Authors, publish date, the abstract, and Keywords -->
<bookinfo>
<title>The &ksystemlog; Handbook</title>
<authorgroup>
<author>
<firstname></firstname>
<othername></othername>
<surname>Nicolas Ternisien</surname>
<affiliation>
<address><email>nicolast@libertysurf.fr</email></address>
</affiliation>
</author>
</authorgroup>
<!-- TRANS:ROLES_OF_TRANSLATORS -->
<copyright>
<year>1999</year>
<year>2005</year>
<holder>Nicolas Ternisien</holder>
</copyright>
<!-- Translators: put here the copyright notice of the translation -->
<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
and in the FDL itself on how to use it. -->
<legalnotice>&FDLNotice;</legalnotice>
<!-- Date and version information of the documentation
Don't forget to include this last date and this last revision number, we
need them for translation coordination !
Please respect the format of the date (YYYY-MM-DD) and of the version
(V.MM.LL), it could be used by automation scripts.
Do NOT change these in the translation. -->
<date>2001-10-18</date>
<releaseinfo>0.1</releaseinfo>
<!-- Abstract about this handbook -->
<abstract>
<para>
&ksystemlog; is an application specially designed to do nothing you would
ever want.
</para>
</abstract>
<!-- This is a set of Keywords for indexing by search engines.
Please at least include KDE, the KDE package it is in, the name
of your application, and a few relevant keywords. -->
<keywordset>
<keyword>KDE</keyword>
<keyword>ksystemlog</keyword>
<keyword>nothing</keyword>
<keyword>nothing else</keyword>
</keywordset>
</bookinfo>
<!-- The contents of the documentation begin here. Label
each chapter so with the id attribute. This is necessary for two reasons: it
allows you to easily reference the chapter from other chapters of your
document, and if there is no ID, the name of the generated HTML files will vary
from time to time making it hard to manage for maintainers and for the CVS
system. Any chapter labelled (OPTIONAL) may be left out at the author's
discretion. Other chapters should not be left out in order to maintain a
consistent documentation style across all KDE apps. -->
<chapter id="introduction">
<title>Introduction</title>
<!-- The introduction chapter contains a brief introduction for the
application that explains what it does and where to report
problems. Basically a long version of the abstract. Don't include a
revision history. (see installation appendix comment) -->
<para>
&ksystemlog; is a program that lets you do absolutely nothing. Please report
any problems or feature requests to the &kde; mailing lists.
</para>
</chapter>
<chapter id="using-ksystemlog">
<title>Using &ksystemlog;</title>
<!-- This chapter should tell the user how to use your app. You should use as
many sections (Chapter, Sect1, Sect3, etc...) as is necessary to fully document
your application. -->
<para>
<!-- Note that all graphics should be in .png format. Use no gifs because of
patent issues. -->
<screenshot>
<screeninfo>Here's a screenshot of &ksystemlog;</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="screenshot.png" format="PNG"/>
</imageobject>
<imageobject>
<imagedata fileref="screenshot.eps" format="EPS"/>
</imageobject>
<textobject>
<phrase>Screenshot</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>
<sect1 id="ksystemlog-features">
<title>More &ksystemlog; features</title>
<para>It slices! It dices! and it comes with a free toaster!</para>
<para>
The Squiggle Tool <guiicon><inlinemediaobject>
<imageobject>
<imagedata fileref="squiggle.png" format="PNG"/>
</imageobject>
<imageobject>
<imagedata fileref="squiggle.eps" format="EPS"/>
</imageobject>
<textobject>
<phrase>Squiggle</phrase>
</textobject>
</inlinemediaobject></guiicon> is used to draw squiggly lines all over
the &ksystemlog; main window. It's not a bug, it's a feature!
</para>
</sect1>
</chapter>
<chapter id="commands">
<title>Command Reference</title>
<!-- (OPTIONAL, BUT RECOMMENDED) This chapter should list all of the
application windows and their menubar and toolbar commands for easy reference.
Also include any keys that have a special function but have no equivalent in the
menus or toolbars. This may not be necessary for small apps or apps with no tool
or menu bars. -->
<sect1 id="ksystemlog-mainwindow">
<title>The main &ksystemlog; window</title>
<sect2>
<title>The File Menu</title>
<para>
<variablelist>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>N</keycap></keycombo>
</shortcut>
<guimenu>File</guimenu>
<guimenuitem>New</guimenuitem>
</menuchoice></term>
<listitem><para><action>Creates a new document</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>
</shortcut>
<guimenu>File</guimenu>
<guimenuitem>Save</guimenuitem>
</menuchoice></term>
<listitem><para><action>Saves the document</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo>
</shortcut>
<guimenu>File</guimenu>
<guimenuitem>Quit</guimenuitem>
</menuchoice></term>
<listitem><para><action>Quits</action> &ksystemlog;</para></listitem>
</varlistentry>
</variablelist>
</para>
</sect2>
<sect2>
<title>The <guimenu>Help</guimenu> Menu</title>
<!-- Assuming you have a standard help menu (help, what's this, about -->
<!-- &ksystemlog;, about KDE) then the documentation is already written. -->
<!-- The following entity is valid anywhere that a variablelist is -->
<!-- valid. -->
&help.menu.documentation;
</sect2>
</sect1>
</chapter>
<chapter id="developers">
<title>Developer's Guide to &ksystemlog;</title>
<!-- (OPTIONAL) A Programming/Scripting reference chapter should be
used for apps that use plugins or that provide their own scripting hooks
and/or development libraries. -->
<para>
Programming &ksystemlog; plugins is a joy to behold. Just read through the next
66 pages of API's to learn how!
</para>
<!-- Use refentries to describe APIs. Refentries are fairly complicated and you
should consult the docbook reference for further details. The example below was
taken from that reference and shortened a bit for readability. -->
<refentry id="re-1007-unmanagechildren-1">
<refmeta>
<refentrytitle>XtUnmanageChildren</refentrytitle>
<refmiscinfo>Xt - Geometry Management</refmiscinfo>
</refmeta>
<refnamediv>
<refname>XtUnmanageChildren
</refname>
<refpurpose>remove a list of children from a parent widget's managed
list.
<indexterm id="ix-1007-unmanagechildren-1"><primary>widgets</primary><secondary>removing</secondary></indexterm>
<indexterm id="ix-1007-unmanagechildren-2"><primary>XtUnmanageChildren</primary></indexterm>
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<refsynopsisdivinfo>
<date>4 March 1996</date>
</refsynopsisdivinfo>
<synopsis>
void XtUnmanageChildren(<replaceable class="parameter">children</replaceable>, <replaceable class="parameter">num_children</replaceable>)
WidgetList <replaceable class="parameter">children</replaceable>;
Cardinal <replaceable class="parameter">num_children</replaceable>;
</synopsis>
<refsect2 id="r2-1007-unmanagechildren-1">
<title>Inputs</title>
<variablelist>
<varlistentry>
<term><replaceable class="parameter">children</replaceable>
</term>
<listitem>
<para>Specifies an array of child widgets. Each child must be of
class RectObj or any subclass thereof.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">num_children</replaceable>
</term>
<listitem>
<para>Specifies the number of elements in <replaceable class="parameter">children</replaceable>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2></refsynopsisdiv>
<refsect1 id="r1-1007-unmanagechildren-1">
<title>Description
</title>
<para><function>XtUnmanageChildren()</function> unmaps the specified widgets
and removes them from their parent's geometry management.
The widgets will disappear from the screen, and (depending
on its parent) may no longer have screen space allocated for
them.
</para>
<para>Each of the widgets in the <replaceable class="parameter">children</replaceable> array must have
the same parent.
</para>
<para>See the &ldquo;Algorithm&rdquo; section below for full details of the
widget unmanagement procedure.
</para>
</refsect1>
<refsect1 id="r1-1007-unmanagechildren-2">
<title>Usage</title>
<para>Unmanaging widgets is the usual method for temporarily
making them invisible. They can be re-managed with
<function>XtManageChildren()</function>.
</para>
<para>You can unmap a widget, but leave it under geometry
management by calling <function>XtUnmapWidget()</function>. You can
destroy a widget's window without destroying the widget by
calling <function>XtUnrealizeWidget()</function>. You can destroy a
widget completely with <function>XtDestroyWidget()</function>.
</para>
<para>If you are only going to unmanage a single widget, it is
more convenient to call <function>XtUnmanageChild()</function>. It is
often more convenient to call <function>XtUnmanageChild()</function>
several times than it is to declare and initialize an array
of widgets to pass to <function>XtUnmanageChildren()</function>. Calling
<function>XtUnmanageChildren()</function> is more efficient, however,
because it only calls the parent's <function>change_managed()</function>
method once.
</para>
</refsect1>
<refsect1 id="r1-1007-unmanagechildren-3">
<title>Algorithm
</title>
<para><function>XtUnmanageChildren()</function> performs the following:
</para>
<variablelist>
<varlistentry>
<term>-
</term>
<listitem>
<para>Ignores the child if it already is unmanaged or is being
destroyed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-
</term>
<listitem>
<para>Otherwise, if the child is realized, it makes it nonvisible
by unmapping it.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
</para>
</refsect1>
<refsect1 id="r1-1007-unmanagechildren-4">
<title>Structures</title>
<para>The <type>WidgetList</type> type is simply an array of widgets:
</para>
<screen id="sc-1007-unmanagechildren-1">typedef Widget *WidgetList;
</screen>
</refsect1>
</refentry>
</chapter>
<chapter id="faq">
<title>Questions and Answers</title>
<!-- (OPTIONAL but recommended) This chapter should include all of the silly
(and not-so-silly) newbie questions that fill up your mailbox. This chapter
should be reserved for BRIEF questions and answers! If one question uses more
than a page or so then it should probably be part of the
"Using this Application" chapter instead. You should use links to
cross-reference questions to the parts of your documentation that answer them.
This is also a great place to provide pointers to other FAQ's if your users
must do some complicated configuration on other programs in order for your
application work. -->
&reporting.bugs;
&updating.documentation;
<qandaset id="faqlist">
<qandaentry>
<question>
<para>My Mouse doesn't work. How do I quit &ksystemlog;?</para>
</question>
<answer>
<para>You silly goose! Check out the <link linkend="commands">Commands
Section</link> for the answer.</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>Why can't I twiddle my documents?</para>
</question>
<answer>
<para>You can only twiddle your documents if you have the foobar.lib
installed.</para>
</answer>
</qandaentry>
</qandaset>
</chapter>
<chapter id="credits">
<!-- Include credits for the programmers, documentation writers, and
contributors here. The license for your software should then be included below
the credits with a reference to the appropriate license file included in the KDE
distribution. -->
<title>Credits and License</title>
<para>
&ksystemlog;
</para>
<para>
Program copyright 2005 Nicolas Ternisien <email>nicolast@libertysurf.fr</email>
</para>
<para>
Contributors:
<itemizedlist>
<listitem><para>Konqui the KDE Dragon <email>konqui@kde.org</email></para>
</listitem>
<listitem><para>Tux the Linux Penguin <email>tux@linux.org</email></para>
</listitem>
</itemizedlist>
</para>
<para>
Documentation copyright 2005 Nicolas Ternisien <email>nicolast@libertysurf.fr</email>
</para>
<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
&underFDL; <!-- FDL: do not remove -->
<!-- Determine which license your application is licensed under,
and delete all the remaining licenses below:
(NOTE: All documentation are licensed under the FDL,
regardless of what license the application uses) -->
&underGPL; <!-- GPL License -->
&underBSDLicense; <!-- BSD License -->
&underArtisticLicense; <!-- BSD Artistic License -->
&underX11License; <!-- X11 License -->
</chapter>
<appendix id="installation">
<title>Installation</title>
<sect1 id="getting-ksystemlog">
<title>How to obtain &ksystemlog;</title>
<!-- This first entity contains boiler plate for applications that are
part of KDE CVS. You should remove it if you are releasing your
application -->
&install.intro.documentation;
</sect1>
<sect1 id="requirements">
<title>Requirements</title>
<!--
List any special requirements for your application here. This should include:
.Libraries or other software that is not included in kdesupport,
kdelibs, or kdebase.
.Hardware requirements like amount of RAM, disk space, graphics card
capabilities, screen resolution, special expansion cards, etc.
.Operating systems the app will run on. If your app is designed only for a
specific OS, (you wrote a graphical LILO configurator for example) put this
information here.
-->
<para>
In order to successfully use &ksystemlog;, you need &kde; 1.1. Foobar.lib is
required in order to support the advanced &ksystemlog; features. &ksystemlog; uses
about 5 megs of memory to run, but this may vary depending on your
platform and configuration.
</para>
<para>
All required libraries as well as &ksystemlog; itself can be found
on <ulink url="ftp://ftp.ksystemlog.org">The &ksystemlog; home page</ulink>.
</para>
<!-- For a list of updates, you may refer to the application web site
or the ChangeLog file, or ... -->
<para>
You can find a list of changes at <ulink
url="http://apps.kde.org/ksystemlog">http://apps.kde.org/ksystemlog</ulink>.
</para>
</sect1>
<sect1 id="compilation">
<title>Compilation and Installation</title>
<!-- This entity contains the boilerplate text for standard -->
<!-- compilation instructions. If your application requires any -->
<!-- special handling, remove it, and replace with your own text. -->
&install.compile.documentation;
</sect1>
<sect1 id="configuration">
<title>Configuration</title>
<para>Don't forget to tell your system to start the <filename>dtd</filename>
dicer-toaster daemon first, or &ksystemlog; won't work !</para>
</sect1>
</appendix>
&documentation.index;
</book>
<!--
Local Variables:
mode: sgml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-indent-step:0
sgml-indent-data:nil
End:
vim:tabstop=2:shiftwidth=2:expandtab
-->

@ -0,0 +1,589 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# KDE tags expanded automatically by am_edit - $Revision: 1.7 $
# ksystemlog/po/Makefile. Generated from Makefile.in by config.pl.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
srcdir = .
top_srcdir = ../..
VPATH = .
pkgdatadir = $(datadir)/ksystemlog
pkglibdir = $(libdir)/ksystemlog
pkgincludedir = $(includedir)/ksystemlog
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c -p
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
target_triplet = i686-pc-linux-gnu
ACLOCAL = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run aclocal-1.7
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run tar
AR = ar
ARTSCCONFIG = /usr/bin/artsc-config
AUTOCONF = $(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure
AUTODIRS =
AUTOHEADER = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run autoheader
AUTOMAKE = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run automake-1.7
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -O2 -Wformat-security -Wmissing-format-attribute
CONF_FILES = $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
CPP = gcc -E
CPPFLAGS = -DQT_THREAD_SUPPORT -D_REENTRANT
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common
CYGPATH_W = echo
DCOPIDL = /usr/bin/dcopidl
DCOPIDL2CPP = /usr/bin/dcopidl2cpp
DCOPIDLNG = /usr/bin/dcopidlng
DCOP_DEPENDENCIES = $(DCOPIDL) $(DCOPIDLNG)
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EXEEXT =
F77 =
FFLAGS =
FRAMEWORK_COREAUDIO =
GMSGFMT = /usr/bin/msgfmt
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG)
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
KCFG_DEPENDENCIES = $(KCONFIG_COMPILER)
KCONFIG_COMPILER = /usr/bin/kconfig_compiler
KDECONFIG = /usr/bin/kde-config
KDE_EXTRA_RPATH =
KDE_INCLUDES = -I/usr/include/kde
KDE_LDFLAGS = -L/usr/lib
KDE_MT_LDFLAGS =
KDE_MT_LIBS = -lpthread
KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
KDE_PLUGIN = -avoid-version -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
KDE_RPATH = -R $(kde_libraries) -R $(qt_libraries) -R $(x_libraries)
KDE_USE_CLOSURE_FALSE =
KDE_USE_CLOSURE_TRUE = #
KDE_USE_FINAL_FALSE =
KDE_USE_FINAL_TRUE = #
KDE_USE_NMCHECK_FALSE =
KDE_USE_NMCHECK_TRUE = #
KDE_XSL_STYLESHEET = /usr/share/apps/ksgmltools2/customization/kde-chunk.xsl
LDFLAGS =
LIBCOMPAT =
LIBCRYPT = -lcrypt
LIBDL = -ldl
LIBJPEG = -ljpeg
LIBOBJS =
LIBPNG = -lpng -lz -lm
LIBPTHREAD = -lpthread
LIBRESOLV = -lresolv
LIBS =
LIBSM = -lSM -lICE
LIBSOCKET =
LIBTOOL = $(SHELL) $(top_builddir)/libtool --silent
LIBUCB =
LIBUTIL = -lutil
LIBZ = -lz
LIB_KAB = -lkab
LIB_KABC = -lkabc
LIB_KDECORE = -lkdecore
LIB_KDEPIM = -lkdepim
LIB_KDEPRINT = -lkdeprint
LIB_KDEUI = -lkdeui
LIB_KFILE = -lkio
LIB_KFM =
LIB_KHTML = -lkhtml
LIB_KIO = -lkio
LIB_KPARTS = -lkparts
LIB_KSPELL = -lkspell
LIB_KSYCOCA = -lkio
LIB_KUTILS = -lkutils
LIB_POLL =
LIB_QPE =
LIB_QT = -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread
LIB_SMB = -lsmb
LIB_X11 = -lX11 $(LIBSOCKET)
LIB_XEXT = -lXext
LIB_XRENDER =
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL} /root/ksystemlog/ksystemlog-0.3.2/admin/missing --run makeinfo
MCOPIDL = /usr/bin/mcopidl
MEINPROC = /usr/bin/meinproc
MOC = /usr/share/qt3/bin/moc
MSGFMT = /usr/bin/msgfmt
NOOPT_CFLAGS = -O0
NOOPT_CXXFLAGS = -O0
OBJEXT = o
PACKAGE = ksystemlog
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_VERSION =
PATH_SEPARATOR = :
PERL = /usr/bin/perl
QTE_NORTTI =
QT_INCLUDES = -I/usr/share/qt3/include
QT_LDFLAGS = -L/usr/share/qt3/lib
RANLIB = ranlib
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
TOPSUBDIRS = ksystemlog
UIC = /usr/share/qt3/bin/uic -L $(kde_widgetdir) -nounload
UIC_TR = tr2i18n
USER_INCLUDES =
USER_LDFLAGS =
USE_EXCEPTIONS = -fexceptions
USE_RTTI =
USE_THREADS =
VERSION = 0.1
WOVERLOADED_VIRTUAL =
XGETTEXT = /usr/bin/xgettext
XMLLINT = /usr/bin/xmllint
X_EXTRA_LIBS =
X_INCLUDES = -I.
X_LDFLAGS = -L/usr/lib
X_PRE_LIBS =
X_RPATH = -R $(x_libraries)
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_F77 =
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
all_includes = -I/usr/include/kde -I/usr/share/qt3/include -I.
all_libraries = -L/usr/lib -L/usr/share/qt3/lib
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = pc
datadir = ${prefix}/share
exec_prefix = ${prefix}
host = i686-pc-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = pc
include_ARTS_FALSE = #
include_ARTS_TRUE =
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /root/ksystemlog/ksystemlog-0.3.2/admin/install-sh
kde_appsdir = ${datadir}/applnk
kde_bindir = ${exec_prefix}/bin
kde_confdir = ${datadir}/config
kde_datadir = ${datadir}/apps
kde_htmldir = ${datadir}/doc/HTML
kde_icondir = ${datadir}/icons
kde_includes = /usr/include/kde
kde_kcfgdir = ${datadir}/config.kcfg
kde_libraries = /usr/lib
kde_libs_htmldir = /usr/share/doc/kde/HTML
kde_libs_prefix = /usr
kde_locale = ${datadir}/locale
kde_mimedir = ${datadir}/mimelnk
kde_moduledir = ${libdir}/kde3
kde_qtver = 3
kde_servicesdir = ${datadir}/services
kde_servicetypesdir = ${datadir}/servicetypes
kde_sounddir = ${datadir}/sounds
kde_styledir = ${libdir}/kde3/plugins/styles
kde_templatesdir = ${datadir}/templates
kde_wallpaperdir = ${datadir}/wallpapers
kde_widgetdir = /usr/lib/kde3/plugins/designer
kdeinitdir = $(kde_moduledir)
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
mandir = ${prefix}/man
oldincludedir = /usr/include
prefix = /usr
program_transform_name = s,x,x,
qt_includes = /usr/share/qt3/include
qt_libraries = /usr/share/qt3/lib
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target = i686-pc-linux-gnu
target_alias =
target_cpu = i686
target_os = linux-gnu
target_vendor = pc
x_includes = .
x_libraries = /usr/lib
xdg_appsdir = ${datadir}/applications/kde
xdg_directorydir = ${datadir}/desktop-directories
xdg_menudir = ${sysconfdir}/xdg/menus
#>- POFILES = AUTO
#>+ 2
POFILES = br.po da.po de.po el.po et.po ga.po fr.po it.po pa.po pl.po rw.po sv.po tr.po en_GB.po
GMOFILES = br.gmo da.gmo de.gmo el.gmo et.gmo ga.gmo fr.gmo it.gmo pa.gmo pl.gmo rw.gmo sv.gmo tr.gmo en_GB.gmo
subdir = ksystemlog/po
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
#>- all: all-am
#>+ 1
all: all-nls docs-am all-am
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
#>- cd $(top_srcdir) && \
#>- $(AUTOMAKE) --gnu ksystemlog/po/Makefile
#>+ 3
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ksystemlog/po/Makefile
cd $(top_srcdir) && perl admin/am_edit ksystemlog/po/Makefile.in
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
#>+ 1
#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
#>+ 1
DISTFILES = $(GMOFILES) $(POFILES) $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
#>- distdir: $(DISTFILES)
#>+ 1
distdir: distdir-nls $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
#>- uninstall: uninstall-am
#>+ 1
uninstall: uninstall-nls uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
#>- clean: clean-am
#>+ 1
clean: kde-rpo-clean clean-am
#>- clean-am: clean-generic clean-libtool mostlyclean-am
#>+ 1
clean-am: clean-bcheck clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
info: info-am
info-am:
#>- install-data-am:
#>+ 1
install-data-am: install-nls
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
#>- maintainer-clean: maintainer-clean-am
#>+ 1
maintainer-clean: clean-nls maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
#>+ 2
KDE_DIST=rw.po Makefile.in da.po sv.po ksystemlog.pot pl.po de.po br.po et.po en_GB.po it.po fr.po ga.po el.po tr.po pa.po
#>+ 43
br.gmo: br.po
rm -f br.gmo; $(GMSGFMT) -o br.gmo $(srcdir)/br.po
test ! -f br.gmo || touch br.gmo
da.gmo: da.po
rm -f da.gmo; $(GMSGFMT) -o da.gmo $(srcdir)/da.po
test ! -f da.gmo || touch da.gmo
de.gmo: de.po
rm -f de.gmo; $(GMSGFMT) -o de.gmo $(srcdir)/de.po
test ! -f de.gmo || touch de.gmo
el.gmo: el.po
rm -f el.gmo; $(GMSGFMT) -o el.gmo $(srcdir)/el.po
test ! -f el.gmo || touch el.gmo
et.gmo: et.po
rm -f et.gmo; $(GMSGFMT) -o et.gmo $(srcdir)/et.po
test ! -f et.gmo || touch et.gmo
ga.gmo: ga.po
rm -f ga.gmo; $(GMSGFMT) -o ga.gmo $(srcdir)/ga.po
test ! -f ga.gmo || touch ga.gmo
fr.gmo: fr.po
rm -f fr.gmo; $(GMSGFMT) -o fr.gmo $(srcdir)/fr.po
test ! -f fr.gmo || touch fr.gmo
it.gmo: it.po
rm -f it.gmo; $(GMSGFMT) -o it.gmo $(srcdir)/it.po
test ! -f it.gmo || touch it.gmo
pa.gmo: pa.po
rm -f pa.gmo; $(GMSGFMT) -o pa.gmo $(srcdir)/pa.po
test ! -f pa.gmo || touch pa.gmo
pl.gmo: pl.po
rm -f pl.gmo; $(GMSGFMT) -o pl.gmo $(srcdir)/pl.po
test ! -f pl.gmo || touch pl.gmo
rw.gmo: rw.po
rm -f rw.gmo; $(GMSGFMT) -o rw.gmo $(srcdir)/rw.po
test ! -f rw.gmo || touch rw.gmo
sv.gmo: sv.po
rm -f sv.gmo; $(GMSGFMT) -o sv.gmo $(srcdir)/sv.po
test ! -f sv.gmo || touch sv.gmo
tr.gmo: tr.po
rm -f tr.gmo; $(GMSGFMT) -o tr.gmo $(srcdir)/tr.po
test ! -f tr.gmo || touch tr.gmo
en_GB.gmo: en_GB.po
rm -f en_GB.gmo; $(GMSGFMT) -o en_GB.gmo $(srcdir)/en_GB.po
test ! -f en_GB.gmo || touch en_GB.gmo
#>+ 3
clean-nls:
-rm -f br.gmo da.gmo de.gmo el.gmo et.gmo ga.gmo fr.gmo it.gmo pa.gmo pl.gmo rw.gmo sv.gmo tr.gmo en_GB.gmo
#>+ 10
install-nls:
@for base in br da de el et ga fr it pa pl rw sv tr en_GB ; do \
echo $(INSTALL_DATA) $$base.gmo $(DESTDIR)$(kde_locale)/$$base/LC_MESSAGES/$(PACKAGE).mo ;\
$(mkinstalldirs) $(DESTDIR)$(kde_locale)/$$base/LC_MESSAGES ; \
if test -f $$base.gmo; then $(INSTALL_DATA) $$base.gmo $(DESTDIR)$(kde_locale)/$$base/LC_MESSAGES/$(PACKAGE).mo ;\
elif test -f $(srcdir)/$$base.gmo; then $(INSTALL_DATA) $(srcdir)/$$base.gmo $(DESTDIR)$(kde_locale)/$$base/LC_MESSAGES/$(PACKAGE).mo ;\
fi ;\
done
#>+ 16
uninstall-nls:
rm -f $(DESTDIR)$(kde_locale)/br/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/da/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/de/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/el/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/et/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/ga/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/fr/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/it/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/pa/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/pl/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/rw/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/sv/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/tr/LC_MESSAGES/$(PACKAGE).mo
rm -f $(DESTDIR)$(kde_locale)/en_GB/LC_MESSAGES/$(PACKAGE).mo
#>+ 2
all-nls: $(GMOFILES)
#>+ 8
distdir-nls:$(GMOFILES)
for file in $(POFILES); do \
cp $(srcdir)/$$file $(distdir); \
done
for file in $(GMOFILES); do \
cp $(srcdir)/$$file $(distdir); \
done
#>+ 4
merge:
$(MAKE) -f $(top_srcdir)/admin/Makefile.common package-merge POFILES="${POFILES}" PACKAGE=${PACKAGE}
#>+ 2
docs-am:
#>+ 6
force-reedit:
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ksystemlog/po/Makefile
cd $(top_srcdir) && perl admin/am_edit ksystemlog/po/Makefile.in
#>+ 21
clean-bcheck:
rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
bcheck: bcheck-am
bcheck-am:
@for i in ; do \
if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
echo "$$i"; \
if ! $(CXX) $(DEFS) -I. -I$(srcdir) -I$(top_builddir) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(KDE_CXXFLAGS) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
rm -f $$i.bchecktest.cc; exit 1; \
fi ; \
echo "" >> $$i.bchecktest.cc.class; \
perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
rm -f a.out; \
fi ; \
done
#>+ 3
final:
$(MAKE) all-am
#>+ 3
final-install:
$(MAKE) install-am
#>+ 3
no-final:
$(MAKE) all-am
#>+ 3
no-final-install:
$(MAKE) install-am
#>+ 3
cvs-clean:
$(MAKE) admindir=$(top_srcdir)/admin -f $(top_srcdir)/admin/Makefile.common cvs-clean
#>+ 3
kde-rpo-clean:
-rm -f *.rpo
#>+ 3
nmcheck:
nmcheck-am: nmcheck

@ -0,0 +1 @@
POFILES = AUTO

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,555 @@
# translation of ksystemlog.po to Deutsch
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.
# Elias Probst <elias.probst@gmx.de>, 2005.
#
msgid ""
msgstr ""
"Project-Id-Version: ksystemlog\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-05-06 14:20+0200\n"
"PO-Revision-Date: 2005-05-09 21:17+0200\n"
"Last-Translator: Elias Probst <elias.probst@gmx.de>\n"
"Language-Team: Deutsch <de@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10\n"
#: bootAuthenticationOptions.cpp:48
msgid "Boot Log File"
msgstr "Log-Datei für Systemstart"
#: bootAuthenticationOptions.cpp:50
msgid "Boot Log File :"
msgstr "Log-Datei für Systemstart:"
#: bootAuthenticationOptions.cpp:57
msgid "Authentication Log File"
msgstr "Authentifizierungs-Log-Datei"
#: bootAuthenticationOptions.cpp:59
msgid "Authentication Log File :"
msgstr "Authentifizierungs-Log-Datei:"
#: cronOptions.cpp:50
msgid ""
"<qt><p>These files will be analyzed to display <b>Cron Logs</b> (i.e. "
"planned tasks logs). This list also determines the order in which the files "
"are read.</p></qt>"
msgstr "<qt><p>Diese Dateien werden analysiert um <b>Cron Log-Dateien</b> (z.B. Log-Dateien geplanter Aufgaben) anzuzeigen. Zudem legt diese Liste fest, in welcher Reihenfolge die Dateien ausgelesen werden.</p></qt>"
#: cronReader.cpp:41 sambaReader.cpp:39 systemReader.cpp:40
msgid "Date"
msgstr "Datum"
#: cronReader.cpp:42 systemReader.cpp:41
msgid "Host Name"
msgstr "Rechnername"
#: cronReader.cpp:43 sambaReader.cpp:42 systemReader.cpp:42
msgid "Process"
msgstr "Prozess"
#: cronReader.cpp:44
msgid "User"
msgstr "Benutzer"
#: cronReader.cpp:45 sambaReader.cpp:43 systemReader.cpp:43 xorgReader.cpp:56
msgid "Message"
msgstr "Nachricht"
#: daemonOptions.cpp:50
msgid ""
"<qt><p>These files will be analyzed to display <b>daemons Logs</b>. This "
"list also determine the order in which the files are read.</p></qt>"
msgstr "<qt><p>Diese Dateien werden analysiert um <b>Daemon Log-Dateien</b> anzuzeigen. Zudem legt diese Liste fest, in welcher Reihenfolge die Dateien ausgelesen werden.</p></qt>"
#: defaultReader.cpp:80
msgid "Opening file '%1'..."
msgstr "Datei '%1' wird geöffnet..."
#: defaultReader.cpp:148
msgid "Log file '%1' loaded successfully."
msgstr "Log-Datei '%1' erfolgreich geladen."
#: defaultReader.cpp:235
msgid "Log file '%1' has changed."
msgstr "Log-Datei '%1' hat sich geändert."
#: defaultReader.cpp:376 ksystemlog.cpp:157 logListItem.cpp:198
msgid "none"
msgstr "nichts"
#: defaultReader.moc.cpp:34 defaultReader.moc.cpp:42
msgid "DefaultReader"
msgstr "StandardLeser"
#: detailDialog.cpp:31
msgid "Log Line Details"
msgstr "Log-Zeilen-Details"
#: detailDialog.cpp:73
msgid "&Next"
msgstr "&Weiter"
#: fileList.cpp:63 fileList.cpp:80
msgid "&Add a file"
msgstr "Datei h&inzufügen"
#: fileList.cpp:69 fileList.cpp:83
msgid "Move &Up"
msgstr "&Nach oben"
#: fileList.cpp:72 fileList.cpp:84
msgid "Move &Down"
msgstr "Nach &unten"
#: fileList.cpp:75 fileList.cpp:86
msgid "Re&move All"
msgstr "Alle ent&fernen"
#: fileList.cpp:79
msgid "File list"
msgstr "Dateiliste"
#: fileList.cpp:123 specificFileList.cpp:83
msgid "All files (*)"
msgstr "Alle Dateien (*)"
#: fileList.cpp:123 specificFileList.cpp:83
msgid "Log files (*.log)"
msgstr "Log-Dateien (*.log)"
#: fileList.cpp:123 specificFileList.cpp:83
msgid "Choose a log file"
msgstr "Wähle eine Log-Datei"
#: fileList.cpp:143
msgid "'%1' is not valid."
msgstr "'%1' ist nicht gültig."
#: fileList.cpp:144 fileList.cpp:151 fileList.cpp:158
msgid "File selection failed"
msgstr "Dateiauswahl fehlgeschlagen"
#: fileList.cpp:150
msgid "'%1' is not a local file."
msgstr "'%1' ist keine lokale Datei."
#: fileList.cpp:157
msgid "'%1' is a folder."
msgstr "'%1' ist ein Verzeichnis."
#: generalOptions.cpp:46
msgid "Parsing"
msgstr "Analysiere"
#: generalOptions.cpp:48
msgid "Parsed line number :"
msgstr "Analysierte Zeilennummer:"
#: kernelOptions.cpp:50
msgid ""
"<qt><p>These files will be analyzed to display <b>Kernel logs</b>. This list "
"also determines the order in which the files are read.</p></qt>"
msgstr "<qt><p>Diese Dateien werden analysiert um <b>Kernel Log-Dateien</b> anzuzeigen. Zudem legt diese Liste fest, in welcher Reihenfolge die Dateien ausgelesen werden.</p></qt>"
#: ksystemlog.cpp:160
msgid "debug"
msgstr "Fehler finden und entfernen"
#: ksystemlog.cpp:162
msgid "information"
msgstr "Information"
#: ksystemlog.cpp:165
msgid "notice"
msgstr "Notiz"
#: ksystemlog.cpp:168
msgid "warning"
msgstr "Warnung"
#: ksystemlog.cpp:171
msgid "error"
msgstr "Fehler"
#: ksystemlog.cpp:174
msgid "critical"
msgstr "Kritisch"
#: ksystemlog.cpp:175
msgid "alert"
msgstr "Alarm"
#: ksystemlog.cpp:176
msgid "emergency"
msgstr "Notfall"
#: ksystemlog.cpp:225
msgid "Resu&me Parsing"
msgstr "A&nalysieren wiederaufnehmen"
#: ksystemlog.cpp:228
msgid "S&top Parsing"
msgstr "Analysieren s&toppen"
#: ksystemlog.cpp:230
msgid "&Details"
msgstr "D&etails"
#: ksystemlog.cpp:233
msgid "S&ystem log"
msgstr "S&ystem-Log"
#: ksystemlog.cpp:234
msgid "&Kernel log"
msgstr "&Kernel-Log"
#: ksystemlog.cpp:235
msgid "&X.org log"
msgstr "&X.org-Log"
#: ksystemlog.cpp:236
msgid "&Boot log"
msgstr "&Systemstart-Log"
#: ksystemlog.cpp:237
msgid "A&uthentication log"
msgstr "A&uthentifizierungs-Log"
#: ksystemlog.cpp:238
msgid "&Daemons log"
msgstr "&Daemon-Log"
#: ksystemlog.cpp:239
msgid "&Planned tasks log"
msgstr "Log ge&planter Aufgaben"
#: ksystemlog.cpp:241
msgid "&Apache log"
msgstr "&Apache-Log"
#: ksystemlog.cpp:242
msgid "Pro&FTP log"
msgstr "Pro&FTP-Log"
#: ksystemlog.cpp:243
msgid "Sa&mba log"
msgstr "Sa&mba-Log"
#: ksystemlog.cpp:245
msgid "&Enable Detailed Tooltips"
msgstr "D&etaillierte Kurzinfos aktivieren"
#: ksystemlog.cpp:248
msgid "&Display New Lines"
msgstr "Ne&ue Zeilen anzeigen"
#: ksystemlog.cpp:359
msgid "%1 log lines."
msgstr "%1 Log-Zeilen."
#: ksystemlog.cpp:363
msgid "Last updating : %1."
msgstr "Zuletzt aktualisiert: %1."
#: ksystemlog.cpp:400
msgid "No items selected. Nothing copied to clipboard."
msgstr "Keine Einträge ausgewählt. Es wurde nichts in die Zwischenablage kopiert."
#: ksystemlog.cpp:407
msgid "%1 log lines copied to clipboard."
msgstr "%1 Log-Zeilen wurden in die Zwischenablage kopiert."
#: ksystemlog.cpp:418
msgid "No items selected. Please select items to be able to save them."
msgstr "Keine Einträge ausgewählt. Bitte Einträge auswählen, um diese speichern zu können."
#: ksystemlog.cpp:448
msgid "%1 log lines saved to '%2'."
msgstr "%1 Log-Zeilen nach '%2' gesichert."
#: ksystemlog.cpp:451
msgid "Unable to save file '%1': Permission Denied."
msgstr "Konnte Datei '%1' nicht speichern: Zugriff wurde verweigert."
#: ksystemlog.cpp:452
msgid "Unable to save file."
msgstr "Konnte Datei nicht speichern."
#: ksystemlog.cpp:569
msgid "Open Location"
msgstr "Datei öffnen"
#: ksystemlog.cpp:582
msgid "Malformed URL. Unable to open this file."
msgstr "Ungültige URL. Datei kann nicht geöffnet werden."
#: ksystemlog.cpp:583
msgid "Unable to open this file."
msgstr "Datei kann nicht geöffnet werden."
#: ksystemlog.cpp:703 ksystemlog.cpp:741 ksystemlog.cpp:799
msgid "URL '%1' is not valid, skipping this URL."
msgstr "Die URL '%1' ist nicht gültig. Übergehe diese URL."
#: ksystemlog.cpp:722
msgid "The two arrays size are different, skipping the reading of log files."
msgstr "Die Größen der Felder sind unterschiedlich. Das Lesen der Log-Dateien wird übersprungen."
#: ksystemlog.cpp:871
msgid "Loading file log..."
msgstr "Log-Datei wird geladen..."
#: ksystemlog.cpp:901 options.cpp:132
msgid "System Log"
msgstr "System-Log"
#: ksystemlog.cpp:933
msgid "Boot Log"
msgstr "Systemstart-Log"
#: ksystemlog.cpp:964
msgid "Authentication Log"
msgstr "Authentifizierungs-Log"
#: ksystemlog.cpp:994 options.cpp:161
msgid "Kernel Log"
msgstr "Kernel-Log"
#: ksystemlog.cpp:1024 options.cpp:215
msgid "Daemons Log"
msgstr "Daemon-Log"
#: ksystemlog.cpp:1059
msgid "Planified tasks Log"
msgstr "Log geplanter Aufgaben"
#: ksystemlog.cpp:1090 options.cpp:242
msgid "X.org Log"
msgstr "X.org-Log"
#: ksystemlog.cpp:1122
msgid "Samba Server Log"
msgstr "Samba Server-Log"
#: logListItem.cpp:123 logListItem.cpp:166
msgid "Date :"
msgstr "Datum:"
#: logListItem.cpp:124 logListItem.cpp:167
msgid "Host Name :"
msgstr "Rechnername:"
#: logListItem.cpp:125 logListItem.cpp:168
msgid "Process :"
msgstr "Prozess:"
#: logListItem.cpp:126
msgid "User :"
msgstr "Benutzer:"
#: logListItem.cpp:127 logListItem.cpp:169
msgid "Level :"
msgstr "Einstufung:"
#: logListItem.cpp:128 logListItem.cpp:170 logListItem.cpp:202
msgid "Original File :"
msgstr "Originaldatei:"
#: logListItem.cpp:141 logListItem.cpp:153 logListItem.cpp:184
msgid "<hr />"
msgstr "<hr/>"
#: logListItem.cpp:198 logListItem.cpp:200
msgid "Type :"
msgstr "Typ:"
#: logListItem.moc.cpp:34 logListItem.moc.cpp:42
msgid "LogListItem"
msgstr "LogListItem"
#: main.cpp:31
msgid "A system log viewer tool for KDE"
msgstr "Ein Programm für KDE um System-Logs darzustellen."
#: main.cpp:37
msgid "Document to open"
msgstr "Zu öffnendes Dokument"
#: main.cpp:43
msgid "KSystemlog"
msgstr "KSystemlog"
#: options.cpp:77
msgid "General"
msgstr "Allgemein"
#: options.cpp:106
msgid "Boot / Authentication"
msgstr "Systemstart/Authentifizierung"
#: options.cpp:106
msgid "Boot && Authentication Logs"
msgstr "Systemstart && Authentifizierungs-Logs"
#: options.cpp:188
msgid "Cron Log"
msgstr "Cron-Log"
#: options.cpp:270
msgid "Samba Log"
msgstr "Samba-Log"
#: rc.cpp:6
#, no-c-format
msgid "Logs"
msgstr "Logs"
#: rc.cpp:9
#, no-c-format
msgid "&Window"
msgstr "&Fenster"
#: rc.cpp:12
#, no-c-format
msgid "Log Toolbar"
msgstr "Log-Werkzeugleiste"
#: rc.cpp:15
#, no-c-format
msgid "Main toolbar"
msgstr "Haupt-Werkzeugleiste"
#: reader.cpp:162
msgid "This file is not valid. Please adjust it in the settings of KSystemLog."
msgstr "Diese Datei ist ungültig. Bitte in den Einstellungen von KSystemLog korrigieren."
#: reader.cpp:163 reader.cpp:175
msgid "The file does not exist"
msgstr "Die Datei existiert nicht"
#: reader.cpp:174
msgid "The file '%1' does not exist."
msgstr "Die Datei '%1' existiert nicht."
#: reader.cpp:183
msgid "You do not have sufficient permissions to read '%1'."
msgstr "Es bestehen nicht genügende Berechtigungen um '%1' zu lesen."
#: reader.cpp:184
msgid "Insufficient permissions"
msgstr "Unzureichende Zugriffsrechte"
#: sambaOptions.cpp:50
msgid ""
"<qt><p>These files will be analyzed to display <b>Samba log</b>. This list "
"also determines the order in which the files are read.</p></qt>"
msgstr "<qt><p>Diese Dateien werden analysiert um <b>Samba Log-Dateien</b> anzuzeigen. Zudem legt diese Liste fest, in welcher Reihenfolge die Dateien ausgelesen werden.</p></qt>"
#: sambaReader.cpp:40
msgid "Time"
msgstr "Zeit"
#: sambaReader.cpp:41
msgid "Host"
msgstr "Rechnername"
#: sortedReader.moc.cpp:34 sortedReader.moc.cpp:42
msgid "SortedReader"
msgstr "SortedReader"
#: specificFileList.cpp:51 specificFileList.cpp:55
msgid "&Change status"
msgstr "Einst&ufung ändern"
#: specificFileList.cpp:111
msgid "Selecting the file type"
msgstr "Dateityp auswählen"
#: specificFileList.cpp:117
msgid "Please select the type of this file :"
msgstr "Bitte den Typ dieser Datei auswählen"
#: specificFileList.cpp:193
msgid "The two arrays size are different, skipping the reading of generic paths."
msgstr "Die beiden Feldgrößen sind unterschiedlich. Das einlesen der Standardpfade wird übersprungen."
#: systemOptions.cpp:50
msgid ""
"<qt><p>These files will be analyzed to display <b>System logs</b>. This list "
"also determines the order in which the files are read.</p></qt>"
msgstr "<qt><p>Diese Dateien werden analysiert um <b>Systen Log-Dateien</b> anzuzeigen. Zudem legt diese Liste fest, in welcher Reihenfolge die Dateien ausgelesen werden.</p></qt>"
#: systemOptions.moc.cpp:34 systemOptions.moc.cpp:42
msgid "SystemOptions"
msgstr "SystemOptions"
#: _translatorinfo.cpp:1
msgid ""
"_: NAME OF TRANSLATORS\n"
"Your names"
msgstr ""
"_: Namen der Übersetzer\n"
"Elias Probst"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr ""
"_: eMail-Adressen der Übersetzer\n"
"elias.probst@gmx.de"
#: view.cpp:77
msgid "Clear search"
msgstr "Suche zurücksetzen"
#: view.cpp:79
msgid "Filter :"
msgstr "Filter:"
#: view.cpp:85
msgid "Column :"
msgstr "Spalte:"
#: view.cpp:164 view.cpp:296
msgid "All"
msgstr "Alles"
#: xorgOptions.cpp:50
msgid ""
"<qt><p>These files will be analyzed to display <b>X.org log</b>. This list "
"also determines the order in which the files are read.</p></qt>"
msgstr "<qt><p>Diese Dateien werden analysiert um <b>X.org Log-Dateien</b> anzuzeigen. Zudem legt diese Liste fest, in welcher Reihenfolge die Dateien ausgelesen werden.</p></qt>"
#: xorgReader.cpp:54
msgid "Order"
msgstr "Reihenfolge"
#: xorgReader.cpp:55
msgid "Type"
msgstr "Typ"
#: xorgReader.cpp:89
msgid "probed"
msgstr "geprüft"
#: xorgReader.cpp:90
msgid "from config file"
msgstr "Aus Konfigurationsdatei"
#: xorgReader.cpp:91
msgid "default setting"
msgstr "Standardeinstellung"
#: xorgReader.cpp:92
msgid "from command Line"
msgstr "Von Kommandozeile"
#: xorgReader.cpp:97
msgid "not implemented"
msgstr "nicht implementiert"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,76 @@
## Makefile.am for ksystemlog
# this is the program that gets installed. it's name is used for all
# of the other Makefile.am variables
bin_PROGRAMS = ksystemlog
# set the include path for X, qt and KDE
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config \
-I$(top_srcdir)/ksystemlog/src/acpid -I$(top_builddir)/ksystemlog/src \
-I$(top_srcdir)/ksystemlog/src/apache -I$(top_srcdir)/ksystemlog/src/bootauth \
-I$(top_srcdir)/ksystemlog/src/cron -I$(top_srcdir)/ksystemlog/src/cups \
-I$(top_srcdir)/ksystemlog/src/daemon -I$(top_srcdir)/ksystemlog/src/kernel \
-I$(top_srcdir)/ksystemlog/src/postfix -I$(top_srcdir)/ksystemlog/src/samba \
-I$(top_srcdir)/ksystemlog/src/system -I$(top_srcdir)/ksystemlog/src/xorg $(all_includes)
# the library search path.
ksystemlog_LDFLAGS = $(KDE_RPATH) $(all_libraries) -lkutils
# the libraries to link against.
ksystemlog_LDADD = \
$(top_builddir)/ksystemlog/src/bootauth/libksystemlog_bootauth.la \
$(top_builddir)/ksystemlog/src/config/libksystemlog_config.la \
$(top_builddir)/ksystemlog/src/acpid/libksystemlog_acpid.la \
$(top_builddir)/ksystemlog/src/daemon/libksystemlog_daemon.la \
$(top_builddir)/ksystemlog/src/cups/libksystemlog_cups.la \
$(top_builddir)/ksystemlog/src/kernel/libksystemlog_kernel.la \
$(top_builddir)/ksystemlog/src/postfix/libksystemlog_postfix.la \
$(top_builddir)/ksystemlog/src/xorg/libksystemlog_xorg.la \
$(top_builddir)/ksystemlog/src/system/libksystemlog_system.la \
$(top_builddir)/ksystemlog/src/cron/libksystemlog_cron.la \
$(top_builddir)/ksystemlog/src/apache/libksystemlog_apache.la \
$(top_builddir)/ksystemlog/src/samba/libksystemlog_samba.la \
$(LIB_KFILE) $(LIB_KDEPRINT)
# which sources should be compiled for ksystemlog
# these are the headers for your project
# client stuff
# let automoc handle all of the meta source files (moc)
METASOURCES = AUTO
messages: rc.cpp
$(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
$(XGETTEXT) *.cpp -o $(podir)/ksystemlog.pot
KDE_ICON = AUTO
# this is where the kdelnk file will go
kdelnkdir = $(kde_appsdir)/Utilities
kdelnk_DATA = ksystemlog.desktop
# this is where the XML-GUI resource file goes
rcdir = $(kde_datadir)/ksystemlog
rc_DATA = ksystemlogui.rc
ksystemlog_SOURCES = detailDialogBase.ui loggerDialogBase.ui detailDialog.cpp \
fileList.cpp generalOptions.cpp globals.cpp ksystemlog.cpp logFile.cpp logLevel.cpp \
logLine.cpp logLineList.cpp logListItem.cpp logViewColumn.cpp main.cpp options.cpp \
reader.cpp specificFileList.cpp view.cpp viewToolTip.cpp logManager.cpp \
defaultReader.cpp logMode.cpp ksystemlogiface.skel childLogLine.cpp parentLogLine.cpp \
logLineTree.cpp readerFactory.cpp itemFactory.cpp logViewColumns.cpp loadingDialog.cpp \
slotLogAction.cpp parsingHelper.cpp logLineFilter.cpp loggerDialog.cpp findManager.cpp
noinst_HEADERS = defaultReader.h detailDialog.h fileList.h generalOptions.h \
globals.h ksystemlogiface.h logFile.h logLevel.h logLine.h logLineList.h \
logListItem.h logViewColumn.h options.h reader.h specificFileList.h view.h \
viewToolTip.h logManager.h logMode.h childLogLine.h parentLogLine.h logLineTree.h \
readerFactory.h itemFactory.h logViewColumns.h loadingDialog.h slotLogAction.h \
slotLogActionCompatibility.h parsingHelper.h logLineFilter.h loggerDialog.h findManager.h
SUBDIRS = config bootauth acpid apache cron system xorg postfix kernel cups daemon samba .

@ -0,0 +1,8 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_acpid.la
libksystemlog_acpid_la_LDFLAGS = $(all_libraries)
libksystemlog_acpid_la_SOURCES = acpidOptions.cpp acpidReader.cpp
noinst_HEADERS = acpidOptions.h acpidReader.h

@ -0,0 +1,104 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "acpidOptions.h"
#include "ksystemlogConfig.h"
AcpidOptions::AcpidOptions(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QString description=i18n("<qt><p>These files will be analyzed to display <b>ACPId log</b>. This list also determines the order in which the files are read.</p></qt>");
fileList=new FileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
AcpidOptions::~AcpidOptions() {
//TODO Delete fileList (and also in other *Options classes)
}
bool AcpidOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void AcpidOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void AcpidOptions::saveConfig() {
kdDebug() << "Save config from AcpidOptions" << endl;
QStringList list;
int count=fileList->count();
for (int i=0; i<count; i++) {
list.push_back(fileList->getText(i));
}
KSystemLogConfig::setAcpidPaths(list);
}
void AcpidOptions::readConfig() {
QStringList files(KSystemLogConfig::acpidPaths());
QStringList::iterator it;
for(it=files.begin(); it!=files.end(); ++it) {
fileList->insertItem(*it);
}
}
#include "acpidOptions.moc"

@ -0,0 +1,63 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _ACPID_OPTIONS_H_
#define _ACPID_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "fileList.h"
class AcpidOptions : public QWidget {
Q_OBJECT
public:
AcpidOptions(QWidget *parent = 0);
~AcpidOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
FileList* fileList;
};
#endif

@ -0,0 +1,113 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include <kmessagebox.h>
#include "parsingHelper.h"
#include "acpidReader.h"
AcpidReader::AcpidReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
}
AcpidReader::~AcpidReader() {
}
void AcpidReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Type"), true, true));
columns->append(new LogViewColumn(i18n("Message"), true, false));
}
LogLine* AcpidReader::parseMessage(QString& logLine, LogFile* logFile) {
int dateBegin=logLine.find("[");
int dateEnd=logLine.find("]");
QString type;
QString message;
QDate date;
QTime time;
//If there is a format problem in the line
if (dateBegin==-1 || dateEnd==-1) {
type=i18n("none");
message=logLine;
date=QDate::currentDate();
time=QTime::currentTime();
}
else {
QString strDate=logLine.mid(dateBegin+1, dateEnd-dateBegin-1);
QString month=strDate.mid(4, 3);
QString day=strDate.mid(8, 2);
QString hour=strDate.mid(11, 2);
QString min=strDate.mid(14, 2);
QString sec=strDate.mid(17, 2);
QString year=strDate.mid(20, 4);
date=QDate(year.toInt(), ParsingHelper::parseMonthNumber(month), day.toInt());
time=QTime(hour.toInt(), min.toInt(), sec.toInt());
//kdDebug() << "Date=" << date.toString() << endl;
//kdDebug() << "Time=" << time.toString() << endl;
logLine=logLine.remove(0, dateEnd+2);
int endType=logLine.find("\"");
//If the " character does not exist, it means that there is no Type category
if (endType==-1) {
type=i18n("none");
message=logLine;
}
else {
type=logLine.left(endType-1);
logLine=logLine.remove(0, endType+1);
message=logLine.left(logLine.length()-2);
}
}
QStringList list;
list.push_back(type);
list.push_back(message);
QString filePath=logFile->url.path();
LogLine* line=new LogLine(date, time, list, filePath, Globals::informationLogLevel, Globals::acpidMode->id);
return(line);
}
#include "acpidReader.moc"

@ -0,0 +1,54 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _ACPID_READER_H_
#define _ACPID_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class AcpidReader : public DefaultReader {
Q_OBJECT
public:
AcpidReader(QObject *parent = 0, const char *name = 0);
virtual ~AcpidReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
};
#endif

@ -0,0 +1,8 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_apache.la
libksystemlog_apache_la_LDFLAGS = $(all_libraries)
libksystemlog_apache_la_SOURCES = apacheAccessReader.cpp apacheOptions.cpp apacheReader.cpp
noinst_HEADERS = apacheAccessReader.h apacheOptions.h apacheReader.h

@ -0,0 +1,119 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include <kmessagebox.h>
#include "parsingHelper.h"
#include "apacheAccessReader.h"
ApacheAccessReader::ApacheAccessReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
}
ApacheAccessReader::~ApacheAccessReader() {
}
void ApacheAccessReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Host Name"), true, true));
columns->append(new LogViewColumn(i18n("Id."), true, true)); //=Identification protocol [From RFC1413 (see Google for more infos)]
columns->append(new LogViewColumn(i18n("User"), true, true));
columns->append(new LogViewColumn(i18n("Response"), true, true));
columns->append(new LogViewColumn(i18n("Bytes Sent"), true, false));
columns->append(new LogViewColumn(i18n("Agent Identity"), true, true));
columns->append(new LogViewColumn(i18n("HTTP Request"), true, false));
columns->append(new LogViewColumn(i18n("URL"), true, true));
}
LogLine* ApacheAccessReader::parseMessage(QString& logLine, LogFile* logFile) {
int spacePos=logLine.find(' ');
QString hostName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.find(' ');
QString identd=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.find(' ');
QString userName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
int endDate=logLine.find(']');
QString strDateTime=logLine.left(endDate);
logLine=logLine.remove(0, endDate+3);
QDateTime dateTime=ParsingHelper::parseDateTimeFromHTTP(strDateTime);
QDate date=dateTime.date();
QTime time=dateTime.time();
int endQuote=logLine.find('\"');
QString message=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+2);
spacePos=logLine.find(' ');
QString httpResponse=ParsingHelper::parseHTTPResponse(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.find(' ');
QString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+2);
QString url;
endQuote=logLine.find('\"');
if (endQuote!=-1) {
url=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+3);
}
QString agent;
//TODO Convert this value to find a more simple name for the Agent
endQuote=logLine.find('\"');
if (endQuote!=-1) {
agent=ParsingHelper::parseAgent(logLine.left(endQuote));
}
QStringList list;
list.push_back(hostName);
list.push_back(identd);
list.push_back(userName);
list.push_back(httpResponse);
list.push_back(bytesSent);
list.push_back(agent);
list.push_back(message);
list.push_back(url);
QString filePath=logFile->url.path();
LogLine* line=new LogLine(date, time, list, filePath, Globals::informationLogLevel, Globals::apacheAccessMode->id);
return(line);
}
#include "apacheAccessReader.moc"

@ -0,0 +1,54 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _APACHE_ACCESS_READER_H_
#define _APACHE_ACCESS_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class ApacheAccessReader : public DefaultReader {
Q_OBJECT
public:
ApacheAccessReader(QObject *parent = 0, const char *name = 0);
virtual ~ApacheAccessReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
};
#endif

@ -0,0 +1,124 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "apacheOptions.h"
#include "ksystemlogConfig.h"
ApacheOptions::ApacheOptions(QWidget *parent) :
QWidget(parent),
tabs(this, "tabs"),
apacheFileList(this, i18n("<qt><p>These files will be analyzed to display <b>Apache log</b>. This list also determines the order in which the files are read.</p></qt>")),
apacheAccessFileList(this, i18n("<qt><p>These files will be analyzed to display <b>Apache Access log</b>. This list also determines the order in which the files are read.</p></qt>"))
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
tabs.addTab(&apacheFileList, Globals::apacheMode->pixmap, Globals::apacheMode->name);
tabs.addTab(&apacheAccessFileList, Globals::apacheAccessMode->pixmap, Globals::apacheAccessMode->name);
connect(&apacheFileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
connect(&apacheAccessFileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
ApacheOptions::~ApacheOptions() {
}
bool ApacheOptions::isValid() {
if (apacheFileList.count()>0 && apacheAccessFileList.count()>0)
return(true);
else
return(false);
}
void ApacheOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void ApacheOptions::saveConfig() {
kdDebug() << "Save config from ApacheOptions" << endl;
QStringList list;
int count=apacheFileList.count();
for (int i=0; i<count; i++) {
list.push_back(apacheFileList.getText(i));
}
KSystemLogConfig::setApachePaths(list);
list.clear();
count=apacheAccessFileList.count();
for (int i=0; i<count; i++) {
list.push_back(apacheAccessFileList.getText(i));
}
KSystemLogConfig::setApacheAccessPaths(list);
}
void ApacheOptions::readConfig() {
QStringList apacheFiles(KSystemLogConfig::apachePaths());
QStringList::iterator it;
for(it=apacheFiles.begin(); it!=apacheFiles.end(); ++it) {
apacheFileList.insertItem(*it);
}
QStringList apacheAccessFiles(KSystemLogConfig::apacheAccessPaths());
for(it=apacheAccessFiles.begin(); it!=apacheAccessFiles.end(); ++it) {
apacheAccessFileList.insertItem(*it);
}
}
#include "apacheOptions.moc"

@ -0,0 +1,68 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _APACHE_OPTIONS_H_
#define _APACHE_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include <ktabwidget.h>
#include "globals.h"
#include "fileList.h"
#include "logMode.h"
class ApacheOptions : public QWidget {
Q_OBJECT
public:
ApacheOptions(QWidget *parent = 0);
~ApacheOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
KTabWidget tabs;
FileList apacheFileList;
FileList apacheAccessFileList;
};
#endif

@ -0,0 +1,154 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include <kmessagebox.h>
#include "parsingHelper.h"
#include "apacheReader.h"
ApacheReader::ApacheReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
initializeTypeLevels();
}
ApacheReader::~ApacheReader() {
}
void ApacheReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Client"), true, false));
columns->append(new LogViewColumn(i18n("Message"), true, false));
}
LogLine* ApacheReader::parseMessage(QString& logLine, LogFile* logFile) {
/*
* Log line examples :
* [Wed May 18 22:16:02 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/ksystemlog/screenshots/small/kernel-view.png, referer: http://localhost.localdomain/ksystemlog/screenshots.php
* [Wed May 18 22:16:02 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/ksystemlog/screenshots/small/system-filter.png, referer: http://localhost.localdomain/ksystemlog/screenshots.php
* [Thu May 19 18:00:19 2005] [notice] mod_jk2.post_config() first invocation
* [Thu May 19 18:00:19 2005] [notice] Digest: generating secret for digest authentication ...
* [client 127.0.0.1] PHP Parse error: parse error, unexpected T_PRIVATE, expecting T_STRING in /mnt/boulot/web/annivernet/src/fonctions/formulaire.inc.php on line 25
*/
QDate date;
QTime time;
QString level;
//Temporary variable
int squareBracket;
//Special case which sometimes happens
if (logLine.find("[client")==0) {
date=QDate::currentDate();
time=QTime::currentTime();
level="notice";
}
else {
//The Date
int dateBegin=logLine.find("[");
int dateEnd=logLine.find("]");
QString type;
QString message;
QString strDate=logLine.mid(dateBegin+1, dateEnd-dateBegin-1);
QString month=strDate.mid(4, 3);
QString day=strDate.mid(8, 2);
QString hour=strDate.mid(11, 2);
QString min=strDate.mid(14, 2);
QString sec=strDate.mid(17, 2);
QString year=strDate.mid(20, 4);
date=QDate(year.toInt(), ParsingHelper::parseMonthNumber(month), day.toInt());
time=QTime(hour.toInt(), min.toInt(), sec.toInt());
logLine=logLine.remove(0, dateEnd+3);
//The log level
squareBracket=logLine.find("]");
level=logLine.left(squareBracket);
logLine=logLine.remove(0, squareBracket+2);
}
//The client
int beginSquareBracket=logLine.find("[client");
squareBracket=logLine.find("]");
QString client;
if (beginSquareBracket==-1 || squareBracket==-1) {
client="";
}
else {
client=logLine.mid(8, squareBracket-8); //8=strlen("[client ")
logLine=logLine.remove(0, squareBracket+2);
}
QStringList list;
list.push_back(client);
list.push_back(logLine);
QString filePath=logFile->url.path();
LogLine* line=new LogLine(date, time, list, filePath, getTypeLevel(level), Globals::apacheMode->id);
return(line);
}
void ApacheReader::initializeTypeLevels() {
mapTypeLevels["notice"]=Globals::informationLogLevel;
mapTypeLevels["warn"]=Globals::warningLogLevel;
mapTypeLevels["error"]=Globals::errorLogLevel;
}
LogLevel* ApacheReader::getTypeLevel(const QString& type) {
QMap<QString, LogLevel*>::iterator it;
it=mapTypeLevels.find(type);
if (it!=mapTypeLevels.end()) {
return(*it);
}
else {
kdDebug() << i18n("New Log Level detected: Please send this log file to the KSystemLog developer to add it.") << endl;
return(Globals::noneLogLevel);
}
}
#include "apacheReader.moc"

@ -0,0 +1,62 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _APACHE_READER_H_
#define _APACHE_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class ApacheReader : public DefaultReader {
Q_OBJECT
public:
ApacheReader(QObject *parent = 0, const char *name = 0);
virtual ~ApacheReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
private:
QMap<QString, LogLevel*> mapTypeLevels;
void initializeTypeLevels();
LogLevel* getTypeLevel(const QString& type);
};
#endif

@ -0,0 +1,8 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_bootauth.la
libksystemlog_bootauth_la_LDFLAGS = $(all_libraries)
libksystemlog_bootauth_la_SOURCES = bootAuthenticationOptions.cpp
noinst_HEADERS = bootAuthenticationOptions.h

@ -0,0 +1,121 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qlabel.h>
#include <qvgroupbox.h>
#include <qbutton.h>
#include <qradiobutton.h>
#include <qwhatsthis.h>
#include <qtooltip.h>
//KDE includes
#include <kfile.h>
#include <klocale.h>
#include <kdialogbase.h>
#include <kiconloader.h>
#include <kapplication.h>
#include <kstandarddirs.h>
#include <kdebug.h>
//Project includes
#include "bootAuthenticationOptions.h"
#include "ksystemlogConfig.h"
BootAuthenticationOptions::BootAuthenticationOptions(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(10);
//Boot log file
QVGroupBox* bootBox=new QVGroupBox(i18n("Boot Log File"), this);
new QLabel(i18n("Boot Log File:"), bootBox);
bootURLRequester=new KURLRequester(bootBox);
bootURLRequester->setMode(KFile::File);
QToolTip::add(bootURLRequester, i18n("<qt>Here, you can type or choose the boot log file (example: <i>/var/log/boot.log</i>).</qt>"));
QWhatsThis::add(bootURLRequester, i18n("<qt>You can type or choose here the boot log file. This file will be analyzed by KSystemLog when you will choose the <b>Boot log</b> menu item. Generally, its name is <i>/var/log/boot.log</i></qt>"));
connect(bootURLRequester, SIGNAL(textChanged(const QString&)), this, SLOT(onOptionsChanged(const QString&)));
//Authentication log file
QVGroupBox* authenticationBox=new QVGroupBox(i18n("Authentication Log File"), this);
new QLabel(i18n("Authentication Log File:"), authenticationBox);
authenticationURLRequester=new KURLRequester(authenticationBox);
authenticationURLRequester->setMode(KFile::File);
QToolTip::add(authenticationURLRequester, i18n("<qt>Here, you can type or choose the authentication log file (example: <i>/var/log/auth.log</i>).</qt>"));
QWhatsThis::add(authenticationURLRequester, i18n("<qt>You can type or choose here the authentication log file. This file will be analyzed by KSystemLog when you will choose the <b>Authentication log</b> menu item. Generally, its name is <i>/var/log/auth.log</i></qt>"));
connect(authenticationURLRequester, SIGNAL(textChanged(const QString&)), this, SLOT(onOptionsChanged(const QString&)));
QSpacerItem* spacer=new QSpacerItem(0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding);
layout->addWidget(bootBox);
layout->addWidget(authenticationBox);
layout->addItem(spacer);
readConfig();
}
void BootAuthenticationOptions::readConfig() {
QString file=KSystemLogConfig::bootPath();
bootURLRequester->setURL(file);
file=KSystemLogConfig::authenticationPath();
authenticationURLRequester->setURL(file);
}
void BootAuthenticationOptions::saveConfig() {
kdDebug() << "Save config from Boot Authentication Options" << endl;
KSystemLogConfig::setAuthenticationPath(bootURLRequester->url());
KSystemLogConfig::setAuthenticationPath(authenticationURLRequester->url());
}
//TODO Please verify that this is OK !
bool BootAuthenticationOptions::isValid() {
KURL test1(bootURLRequester->url());
KURL test2(authenticationURLRequester->url());
if (test1.isValid() && test2.isValid())
return(true);
else
return(false);
}
void BootAuthenticationOptions::onOptionsChanged(const QString& /*text*/) {
emit optionsChanged(true);
}
#include "bootAuthenticationOptions.moc"

@ -0,0 +1,60 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _BOOT_AUTHENTICATION_OPTIONS_H_
#define _BOOT_AUTHENTICATION_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <qbuttongroup.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include "globals.h"
class BootAuthenticationOptions : public QWidget {
Q_OBJECT
public:
BootAuthenticationOptions(QWidget *parent = 0);
bool isValid();
public slots:
void saveConfig();
void readConfig();
signals:
void optionsChanged(bool valid);
private slots:
void onOptionsChanged(const QString&);
private:
KURLRequester* bootURLRequester;
KURLRequester* authenticationURLRequester;
};
#endif // _BOOT_AUTHENTICATION_OPTIONS_H_

@ -0,0 +1,45 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "parentLogLine.h"
#include "childLogLine.h"
ChildLogLine::ChildLogLine(QDate& date, QTime& time, QStringList& list, QString& file, LogLevel* level, int type) :
LogLine(date, time, list, file, level, type),
parent(NULL) {
}
ChildLogLine::~ChildLogLine() {
}
void ChildLogLine::setParent(ParentLogLine* line) {
parent=line;
}
ParentLogLine* ChildLogLine::getParent() {
return(parent);
}
bool ChildLogLine::isChildLogLine() {
return(true);
}

@ -0,0 +1,55 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _CHILD_LOG_LINE_H_
#define _CHILD_LOG_LINE_H_
#include <qobject.h>
#include <kurl.h>
#include "globals.h"
#include "logLine.h"
class ParentLogLine;
/**
* @author Nicolas Ternisien
*/
class ChildLogLine : public LogLine {
public:
ChildLogLine(QDate& date, QTime& time, QStringList& list, QString& originalFile, LogLevel* level, int tpe);
virtual ~ChildLogLine();
void setParent(ParentLogLine* line);
ParentLogLine* getParent();
virtual bool isChildLogLine();
protected:
ParentLogLine* parent;
};
#endif

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_config.la
libksystemlog_config_la_SOURCES = ksystemlogConfig.kcfgc dummyConfig.cpp
kde_kcfg_DATA = ksystemlog.kcfg

@ -0,0 +1,20 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="ksystemlogrc" />
<group name="ksystemlog">
<entry name="MaxLines" type="Int">
<label>The log view line count limit.</label>
<default>1000</default>
</entry>
<entry name="MaxReadCharacters" type="Int">
<label>The maximum number of characters read per line.</label>
<default>1024</default>
</entry>
<entry name="DeleteDuplicatedLines" type="Bool">
<label>Option is true when user want to delete same log lines.</label>
<default>false</default>
</entry>
<entry name="DeleteProcessIdentifier" type="Bool">
<label>Does we display the PID in the process column of the SystemLog ?</label>
<default>false</default>
</entry>
<entry name="ColorizeLogLines" type="Bool">
<label>Does we colorize the log lines depending of their log level ?</label>
<default>true</default>
</entry>
<entry name="TooltipEnabled" type="Bool">
<label>Is the tooltip enabled.</label>
<default>true</default>
</entry>
<entry name="NewLinesDisplayed" type="Bool">
<label>Is the new lines displayed.</label>
<default>true</default>
</entry>
<entry name="ToggleFilterBar" type="Bool">
<label>Does we display the filter bar.</label>
<default>true</default>
</entry>
<entry name="GroupBy" type="IntList">
<label>The group by method.</label>
<default></default>
</entry>
<entry name="GroupByColumns" type="IntList">
<label>The column which the list is grouped by.</label>
<default>-1</default>
</entry>
<!-- System config entries -->
<entry name="SystemPaths" type="StringList">
<label>The System log files paths.</label>
<default>/var/log/syslog</default>
</entry>
<entry name="SystemLevels" type="IntList">
<label>The System log files levels.</label>
<default>2</default>
</entry>
<!-- Kernel config entries -->
<entry name="KernelPaths" type="StringList">
<label>The Kernel log files paths.</label>
<default>/var/log/kern.log</default>
</entry>
<entry name="KernelLevels" type="IntList">
<label>The Kernel log files levels.</label>
<default>2,4,5</default>
</entry>
<!-- Cron config entries -->
<entry name="CronPaths" type="StringList">
<label>The Cron log files paths.</label>
<default>/var/log/cron.log</default>
</entry>
<entry name="CronLevels" type="IntList">
<label>The Cron log files levels.</label>
<default>2,4,5</default>
</entry>
<!-- Daemon config entries -->
<entry name="DaemonPaths" type="StringList">
<label>The Daemon log files paths.</label>
<default>/var/log/daemon.log</default>
</entry>
<entry name="DaemonLevels" type="IntList">
<label>The Daemon log files levels.</label>
<default>2,4,5</default>
</entry>
<!-- X.org config entries -->
<entry name="XorgPaths" type="StringList">
<label>The Xorg log files paths.</label>
<default>/var/log/Xorg.0.log</default>
</entry>
<!-- Cups config entries -->
<entry name="CupsPaths" type="StringList">
<label>The Cups log files paths.</label>
<default>/var/log/cups/error_log</default>
</entry>
<!-- Cups Access config entries -->
<entry name="CupsAccessPaths" type="StringList">
<label>The Cups Access log files paths.</label>
<default>/var/log/cups/access_log</default>
</entry>
<!-- Apache config entries -->
<entry name="ApachePaths" type="StringList">
<label>The Apache log files paths.</label>
<default>/var/log/apache/error.log</default>
</entry>
<!-- Apache Access config entries -->
<entry name="ApacheAccessPaths" type="StringList">
<label>The Apache Access log files paths.</label>
<default>/var/log/apache/access.log</default>
</entry>
<!-- Postfix config entries -->
<entry name="PostfixPaths" type="StringList">
<label>The Postfix log files paths.</label>
<default>/var/log/mail.info,/var/log/mail.warn,/var/log/mail.err</default>
</entry>
<entry name="PostfixLevels" type="IntList">
<label>The Postfix log files levels.</label>
<default>2,4,5</default>
</entry>
<!-- Samba config entries -->
<entry name="SambaPaths" type="StringList">
<label>The Samba log files paths.</label>
<default>/var/log/samba/log.nmbd,/var/log/samba/log.smbd</default>
</entry>
<!-- ACPID config entries -->
<entry name="AcpidPaths" type="StringList">
<label>The Acpid log files paths.</label>
<default>/var/log/acpid</default>
</entry>
<!-- Boot config entries -->
<entry name="BootPath" type="String">
<label>The Boot log file path.</label>
<default>/var/log/boot.log</default>
</entry>
<!-- Authentication config entries -->
<entry name="AuthenticationPath" type="String">
<label>The Authentication log files paths.</label>
<default>/var/log/auth.log</default>
</entry>
<entry name="LogModes" type="IntList">
<label>The current log modes (one log mode per tab).</label>
<default>2</default>
</entry>
<entry name="OpenedURLs" type="StringList">
<label>The last opened URL if the mode was equals to OPENING_MODE. As many items as there are LogMode=OPENING_MODE.</label>
</entry>
<entry name="SelectedTab" type="Int">
<label>The last selected tab.</label>
<default>0</default>
</entry>
</group>
</kcfg>

@ -0,0 +1,4 @@
File=ksystemlog.kcfg
ClassName=KSystemLogConfig
Singleton=true
Mutators=true

@ -0,0 +1,8 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_cron.la
libksystemlog_cron_la_LDFLAGS = $(all_libraries)
libksystemlog_cron_la_SOURCES = cronOptions.cpp cronReader.cpp
noinst_HEADERS = cronOptions.h cronReader.h

@ -0,0 +1,99 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "cronOptions.h"
#include "ksystemlogConfig.h"
CronOptions::CronOptions(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QString description= i18n("<qt><p>These files will be analyzed to display <b>Cron Logs</b> (i.e. planned tasks logs). This list also determines the order in which the files are read.</p></qt>");
fileList=new SpecificFileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
CronOptions::~CronOptions() {
//TODO Delete fileList
}
bool CronOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void CronOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void CronOptions::saveConfig() {
kdDebug() << "Saving config from Cron Options..." << endl;
QStringList stringList;
QValueList<int> valueList;
fileList->saveConfig(stringList, valueList);
KSystemLogConfig::setCronPaths(stringList);
KSystemLogConfig::setCronLevels(valueList);
}
void CronOptions::readConfig() {
QStringList stringList=KSystemLogConfig::cronPaths();
QValueList<int> valueList=KSystemLogConfig::cronLevels();
fileList->readConfig(stringList, valueList);
}
#include "cronOptions.moc"

@ -0,0 +1,61 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _CRON_OPTIONS_H_
#define _CRON_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "specificFileList.h"
#include "logLevel.h"
class CronOptions : public QWidget {
Q_OBJECT
public:
CronOptions(QWidget *parent = 0);
~CronOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
SpecificFileList* fileList;
};
#endif

@ -0,0 +1,81 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "cronReader.h"
#include <klocale.h>
#include <kmessagebox.h>
CronReader::CronReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
}
CronReader::~CronReader() {
}
void CronReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Host Name"), true, true));
columns->append(new LogViewColumn(i18n("Process"), true, true));
columns->append(new LogViewColumn(i18n("User"), true, true));
columns->append(new LogViewColumn(i18n("Message"), true, false));
}
/**
* TODO Improve speed of this method
*/
LogLine* CronReader::parseMessage(QString& line, LogFile* logFile) {
//Use the default parsing
LogLine* logLine=DefaultReader::parseMessage(line, logFile);
QStringList& list=logLine->getItemList();
//Gets the message column (last item) and deletes it
QString message=list.back();
list.pop_back();
int leftBracket=message.find('(');
int rightBracket=message.find(')');
QString user=message.mid(leftBracket+1, rightBracket-leftBracket-1);
list.push_back(user);
message=message.right(message.length() - rightBracket-2);
list.push_back(message);
//This log line comes from Cron Reader
logLine->setType(Globals::cronMode->id);
return(logLine);
}
#include "cronReader.moc"

@ -0,0 +1,55 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _CRON_READER_H_
#define _CRON_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class CronReader : public DefaultReader {
Q_OBJECT
public:
CronReader(QObject *parent = 0, const char *name = 0);
virtual ~CronReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
};
#endif

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_cups.la
libksystemlog_cups_la_LDFLAGS = $(all_libraries)
libksystemlog_cups_la_SOURCES = cupsAccessReader.cpp cupsOptions.cpp cupsReader.cpp
noinst_HEADERS = cupsAccessReader.h cupsOptions.h cupsReader.h

@ -0,0 +1,100 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include <kmessagebox.h>
#include "parsingHelper.h"
#include "cupsAccessReader.h"
CupsAccessReader::CupsAccessReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
}
CupsAccessReader::~CupsAccessReader() {
}
void CupsAccessReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Host Name"), true, true));
columns->append(new LogViewColumn(i18n("Id."), true, true)); //=Identification protocol [From RFC1413 (see Google for more infos)]
columns->append(new LogViewColumn(i18n("User"), true, true));
columns->append(new LogViewColumn(i18n("Response"), true, true));
columns->append(new LogViewColumn(i18n("Bytes Sent"), true, false));
columns->append(new LogViewColumn(i18n("HTTP Request"), true, false));
}
LogLine* CupsAccessReader::parseMessage(QString& logLine, LogFile* logFile) {
int spacePos=logLine.find(' ');
QString hostName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.find(' ');
QString identd=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.find(' ');
QString userName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
int endDate=logLine.find(']');
QString strDateTime=logLine.left(endDate);
logLine=logLine.remove(0, endDate+3);
QDateTime dateTime=ParsingHelper::parseDateTimeFromHTTP(strDateTime);
QDate date=dateTime.date();
QTime time=dateTime.time();
int endQuote=logLine.find('\"');
QString message=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+2);
spacePos=logLine.find(' ');
QString httpResponse=ParsingHelper::parseHTTPResponse(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.find(' ');
QString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos));
QStringList list;
list.push_back(hostName);
list.push_back(identd);
list.push_back(userName);
list.push_back(httpResponse);
list.push_back(bytesSent);
list.push_back(message);
QString filePath=logFile->url.path();
LogLine* line=new LogLine(date, time, list, filePath, Globals::informationLogLevel, Globals::cupsAccessMode->id);
return(line);
}
#include "cupsAccessReader.moc"

@ -0,0 +1,54 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _CUPS_ACCESS_READER_H_
#define _CUPS_ACCESS_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class CupsAccessReader : public DefaultReader {
Q_OBJECT
public:
CupsAccessReader(QObject *parent = 0, const char *name = 0);
virtual ~CupsAccessReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
};
#endif

@ -0,0 +1,124 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "cupsOptions.h"
#include "ksystemlogConfig.h"
CupsOptions::CupsOptions(QWidget *parent) :
QWidget(parent),
tabs(this, "tabs"),
cupsFileList(this, i18n("<qt><p>These files will be analyzed to display <b>Cups log</b>. This list also determines the order in which the files are read.</p></qt>")),
cupsAccessFileList(this, i18n("<qt><p>These files will be analyzed to display <b>Cups Web Server log</b>. This list also determines the order in which the files are read.</p></qt>"))
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
tabs.addTab(&cupsFileList, Globals::cupsMode->pixmap, Globals::cupsMode->name);
tabs.addTab(&cupsAccessFileList, Globals::cupsAccessMode->pixmap, Globals::cupsAccessMode->name);
connect(&cupsFileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
connect(&cupsAccessFileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
CupsOptions::~CupsOptions() {
}
bool CupsOptions::isValid() {
if (cupsFileList.count()>0 && cupsAccessFileList.count()>0)
return(true);
else
return(false);
}
void CupsOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void CupsOptions::saveConfig() {
kdDebug() << "Save config from CupsOptions" << endl;
QStringList list;
int count=cupsFileList.count();
for (int i=0; i<count; i++) {
list.push_back(cupsFileList.getText(i));
}
KSystemLogConfig::setCupsPaths(list);
list.clear();
count=cupsAccessFileList.count();
for (int i=0; i<count; i++) {
list.push_back(cupsAccessFileList.getText(i));
}
KSystemLogConfig::setCupsAccessPaths(list);
}
void CupsOptions::readConfig() {
QStringList cupsFiles(KSystemLogConfig::cupsPaths());
QStringList::iterator it;
for(it=cupsFiles.begin(); it!=cupsFiles.end(); ++it) {
cupsFileList.insertItem(*it);
}
QStringList cupsAccessFiles(KSystemLogConfig::cupsAccessPaths());
for(it=cupsAccessFiles.begin(); it!=cupsAccessFiles.end(); ++it) {
cupsAccessFileList.insertItem(*it);
}
}
#include "cupsOptions.moc"

@ -0,0 +1,69 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _CUPS_OPTIONS_H_
#define _CUPS_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include <ktabwidget.h>
#include "globals.h"
#include "fileList.h"
#include "logMode.h"
class CupsOptions : public QWidget {
Q_OBJECT
public:
CupsOptions(QWidget *parent = 0);
~CupsOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
KTabWidget tabs;
FileList cupsFileList;
FileList cupsAccessFileList;
};
#endif

@ -0,0 +1,106 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include <kmessagebox.h>
#include "parsingHelper.h"
#include "cupsReader.h"
#define DEBUG2_LOG_LEVEL_ICON "source"
CupsReader::CupsReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
initializeTypeLevels();
}
CupsReader::~CupsReader() {
}
void CupsReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Message"), true, false));
}
LogLine* CupsReader::parseMessage(QString& logLine, LogFile* logFile) {
/*
* Log line examples :
* I [15/Feb/2004:01:29:32 +0100] LoadPPDs: No new or changed PPDs...
* E [15/Feb/2004:01:43:15 +0100] Scheduler shutting down due to SIGTERM.
*/
QChar level=logLine[0];
QString strDateTime=logLine.mid(2, 28);
QDateTime dateTime=ParsingHelper::parseDateTimeFromHTTP(strDateTime);
QDate date=dateTime.date();
QTime time=dateTime.time();
QString message=logLine.remove(0, 31);
LogLevel* logLevel=getTypeLevel(level);
QStringList list;
list.push_back(message);
QString filePath=logFile->url.path();
LogLine* line=new LogLine(date, time, list, filePath, logLevel, Globals::cupsMode->id);
return(line);
}
void CupsReader::initializeTypeLevels() {
mapTypeLevels['d']=new LogLevel(20, i18n("debug 2"), DEBUG2_LOG_LEVEL_ICON, QColor(169, 189, 165));
mapTypeLevels['D']=Globals::debugLogLevel;
mapTypeLevels['I']=Globals::informationLogLevel;
mapTypeLevels['N']=Globals::noticeLogLevel;
mapTypeLevels['W']=Globals::warningLogLevel;
mapTypeLevels['E']=Globals::errorLogLevel;
mapTypeLevels['C']=Globals::criticalLogLevel;
mapTypeLevels['A']=Globals::alertLogLevel;
mapTypeLevels['X']=Globals::emergencyLogLevel;
mapTypeLevels[' ']=Globals::noneLogLevel;
}
LogLevel* CupsReader::getTypeLevel(const QChar& type) {
QMap<QChar, LogLevel*>::iterator it;
it=mapTypeLevels.find(type);
if (it!=mapTypeLevels.end()) {
return(*it);
}
else {
kdDebug() << i18n("New Log Level detected: Please send this log file to the KSystemLog developer to add it.") << endl;
return(Globals::noneLogLevel);
}
}
#include "cupsReader.moc"

@ -0,0 +1,63 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _CUPS_READER_H_
#define _CUPS_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class CupsReader : public DefaultReader {
Q_OBJECT
public:
CupsReader(QObject *parent = 0, const char *name = 0);
virtual ~CupsReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
private:
QMap<QChar, LogLevel*> mapTypeLevels;
void initializeTypeLevels();
LogLevel* getTypeLevel(const QChar& type);
};
#endif

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_daemon.la
libksystemlog_daemon_la_LDFLAGS = $(all_libraries)
libksystemlog_daemon_la_SOURCES = daemonOptions.cpp
noinst_HEADERS = daemonOptions.h

@ -0,0 +1,99 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "daemonOptions.h"
#include "ksystemlogConfig.h"
DaemonOptions::DaemonOptions(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QString description= i18n("<qt><p>These files will be analyzed to display <b>daemons Logs</b>. This list also determine the order in which the files are read.</p></qt>");
fileList=new SpecificFileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
DaemonOptions::~DaemonOptions() {
}
bool DaemonOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void DaemonOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void DaemonOptions::saveConfig() {
kdDebug() << "Saving config from Daemon Options..." << endl;
QStringList stringList;
QValueList<int> valueList;
fileList->saveConfig(stringList, valueList);
KSystemLogConfig::setDaemonPaths(stringList);
KSystemLogConfig::setDaemonLevels(valueList);
}
void DaemonOptions::readConfig() {
QStringList stringList=KSystemLogConfig::daemonPaths();
QValueList<int> valueList=KSystemLogConfig::daemonLevels();
fileList->readConfig(stringList, valueList);
}
#include "daemonOptions.moc"

@ -0,0 +1,59 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _DAEMON_OPTIONS_H_
#define _DAEMON_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "specificFileList.h"
#include "logLevel.h"
class DaemonOptions : public QWidget {
Q_OBJECT
public:
DaemonOptions(QWidget *parent = 0);
~DaemonOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
SpecificFileList* fileList;
};
#endif

@ -0,0 +1,498 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include <kmessagebox.h>
#include "logListItem.h"
#include "ksystemlogConfig.h"
#include "logLine.h"
#include "view.h"
#include "parsingHelper.h"
#include "defaultReader.h"
DefaultReader::DefaultReader(QObject *parent, const char *name) :
Reader(parent, name),
buffers(NULL)
{
}
DefaultReader::~DefaultReader() {
delete buffers;
}
void DefaultReader::readLog() {
//Each file in the Log file list are watched with the following method
watchLogFiles();
if (buffers!=NULL)
delete buffers;
if (logManager->getGroupBy()==NO_GROUP_BY)
buffers=new LogLineList();
else {
buffers=new LogLineTree(logManager->getColumns(), logManager->getGroupBy(), logManager->getGroupByColumn());
}
LogFiles& files=logManager->getLogFiles();
//Inform connected QObject that the reading has begun
emit readingBegin();
//Read each file of the list, and place their lines in the buffer
int i=files.count()-1;
LogFile* logFile;
while(i>=0) {
logFile=files[i];
kdDebug() << "Reading file " << logFile->url.path() << endl;
this->readFile(logFile);
i--;
}
//Synchronize the buffer once we have fill it
logManager->synchronize(buffers);
//Says to the buffer that we have read all files, and that
//the next adding will come from logChanged method
if (!buffers->isEmpty())
buffers->setFirstReadPerformed(true);
//Inform connected QObject that the reading is now finished
emit readingEnd();
//Emit a signal which informs connected slots that there are new lines
emit logUpdated(logManager->getView()->getLogList()->childCount());
}
void DefaultReader::readFile(LogFile* logFile) {
QString message=i18n("Opening file '%1'...").arg(logFile->url.path());
emit statusbarChanged(message);
//Inform connected QObject that we are now reading the "index" file
emit readingFile(logManager->getLogFiles().count() - logManager->getLogFiles().findIndex(logFile));
//We initialize these values from configuration to be used by the insert methods
tmpDeleteDuplicate=KSystemLogConfig::deleteDuplicatedLines();
tmpDeleteProcessId=KSystemLogConfig::deleteProcessIdentifier();
tmpMaxLines=KSystemLogConfig::maxLines();
tmpMaxCharacters=KSystemLogConfig::maxReadCharacters();
//Open the file
QFile* file=this->openFile(logFile->url.path());
//If an error occurs, end this method
if (file==NULL) {
return;
}
QString buffer;
QString filePath=logFile->url.path();
//Insert the content of the file in a string list
QStringList* rawBuffer=getRawBuffer(file);
//If there is no line
if (rawBuffer->size()==0) {
QString message=i18n("No log line in '%1'.").arg(logFile->url.path());
emit statusbarChanged(message);
delete rawBuffer;
return;
}
kdDebug() << "Testing each line..." << endl;
QStringList::iterator it;
it=rawBuffer->end();
it--;
//Calculate how many lines we will read
int size=rawBuffer->size();
int stop;
if (size>tmpMaxLines)
stop=size-tmpMaxLines;
else
stop=0;
//Test each line of the raw buffer
int i=size-1;
int progress=0;
int progressTotal=size-1 - stop;
int each=progressTotal / 100;
if (each==0)
each=progressTotal;
while(i>=stop) {
buffer=*it;
if (insertOrReplaceLine(buffer, logFile)==false)
break;
it--;
i--;
if (i>=0 && i%each==0) {
emit openingProgressed(progress++);
}
}
delete rawBuffer;
logFile->lastFileSize=file->size();
// Close the file
this->closeFile(file);
message=i18n("Log file '%1' loaded successfully.").arg(logFile->url.path());
emit statusbarChanged(message);
}
void DefaultReader::logChanged(LogFile* logFile) {
kdDebug() << "SortedReader : File has been modified !" << endl;
//We initialize these values from configuration to be used by the insert methods
tmpDeleteDuplicate=KSystemLogConfig::deleteDuplicatedLines();
tmpDeleteProcessId=KSystemLogConfig::deleteProcessIdentifier();
tmpMaxLines=KSystemLogConfig::maxLines();
tmpMaxCharacters=KSystemLogConfig::maxReadCharacters();
QString buffer;
QString filePath=logFile->url.path();
QFile* file=this->openFile(filePath);
if (file==NULL)
return;
//If there are new lines in the file, insert only them
if (logFile->lastFileSize <= (int) file->size()) {
//Place the cursor to the last line opened
file->at(logFile->lastFileSize);
kdDebug() << "Retrieving a part of the file..." << endl;
//Get the maximum number of line read from LogManager
int maxLines=KSystemLogConfig::maxLines();
QString buffer;
QStringList* rawBuffer=getRawBuffer(file);
//If there is no line
if (rawBuffer->size()==0) {
delete rawBuffer;
return;
}
kdDebug() << "Testing each line..." << endl;
QStringList::iterator it;
it=rawBuffer->end();
it--;
//Calculate how many lines we will read
int size=rawBuffer->size();
int stop=0;
if (size>maxLines)
stop=size-maxLines;
//Test each line of the raw buffer
int i=size-1;
while(i>=stop) {
buffer=*it;
if (insertOrReplaceLine(buffer, logFile)==false)
break;
it--;
i--;
}
kdDebug() << "Total read lines : " << (size-1-i) << endl;
delete rawBuffer;
}
//Else reread all lines, clear log list
else {
buffers->clear();
file->close();
this->readFile(logFile);
}
int newLineCount=buffers->getNewLineCount();
logManager->synchronize(buffers);
//Get the size file for the next calculation
logFile->lastFileSize=file->size();
// Close the file
this->closeFile(file);
QString message;
message=i18n("Log file '%1' has changed.").arg(logFile->url.path());
emit statusbarChanged(message);
//Emit a signal which informs connected slots that there are new lines
emit logUpdated(newLineCount);
}
bool DefaultReader::insertLine(QString& buffer, LogFile* originalFile) {
LogLine* line=this->parseMessage(buffer, originalFile);
//Do not insert the line if it NULL
//TODO Maybe return true (because we don't want to stop the reading for one dirty line)
if (line==NULL)
return(false);
//If the Delete Duplicated Line is checked, we first test that the line is really new
if (tmpDeleteDuplicate==true) {
if (buffers->lineAlreadyExists(line)==true)
return(true);
}
//If the line is newer, it can be inserted
if (buffers->isNewer(line)==true) {
if (buffers->getItemCount()<tmpMaxLines) {
buffers->insert(line);
}
else {
return(false);
}
}
//If the line is older, then inserts it only if there is still space in the buffer
else if (buffers->getItemCount()<tmpMaxLines) {
buffers->insert(line);
}
return(true);
}
bool DefaultReader::insertOrReplaceLine(QString& buffer, LogFile* originalFile) {
LogLine* line=this->parseMessage(buffer, originalFile);
//Do not insert the line if it NULL
//TODO Maybe return true (because we don't want to stop the reading for one dirty line)
if (line==NULL)
return(false);
//If the Delete Duplicated Line is checked, we first test that the line is really new
if (tmpDeleteDuplicate==true) {
if (buffers->lineAlreadyExists(line)==true) {
return(true);
}
}
//If the line is newer, it can be inserted
if (buffers->isNewer(line)==true) {
if (buffers->getItemCount()<tmpMaxLines) {
buffers->insert(line);
return(true);
}
else {
buffers->removeOldestLine();
buffers->insert(line);
return(true);
}
}
//If the line is older, then inserts it only if there is still space in the buffer
else if (buffers->getItemCount()<tmpMaxLines) {
buffers->insert(line);
return(true);
}
return(false);
}
/**
* TODO Improve speed of this method (with KRegExp class for example)
*/
LogLine* DefaultReader::parseMessage(QString& logLine, LogFile* originalFile) {
//kdDebug() << "Please don't use parseMessage() from SortedReader class" << endl;
int year=QDate::currentDate().year();
//Month number
QString month;
month=logLine.left(3);
logLine=logLine.remove(0, 4);
int monthNum=ParsingHelper::parseMonthNumber(month);
//Day number
QString day;
day=logLine.left(2);
int dayNum=day.toInt();
logLine=logLine.remove(0, 3);
QDate date(year, monthNum, dayNum);
if (!date.isValid()) {
kdDebug() << "Malformed date" << endl;
date=QDate::currentDate();
}
//Time
QString stringTime;
stringTime=logLine.left(8);
int h=stringTime.left(2).toInt();
stringTime.remove(0, 3);
int m=stringTime.left(2).toInt();
stringTime.remove(0, 3);
int s=stringTime.left(2).toInt();
stringTime.remove(0, 3);
QTime time(h, m, s);
if (!time.isValid()) {
kdDebug() << "Malformed time" << endl;
time=QTime::currentTime();
}
//QStringList
logLine=logLine.remove(0, 9);
int nextSpace;
nextSpace=logLine.find(' ');
//Host name
QString hostname;
hostname=logLine.left(nextSpace);
logLine=logLine.remove(0, nextSpace+1);
QString process;
QString message;
//Process name
nextSpace=logLine.find(':');
if (nextSpace!=-1) {
process=logLine.left(nextSpace);
//If the delete process identifier option is enabled
if (tmpDeleteProcessId==true) {
int squareBracket=process.find('[');
//If we find a bracket, we remove the useless part
if (squareBracket!=-1) {
process=process.left(squareBracket);
}
}
logLine=logLine.remove(0, nextSpace+1);
message=logLine.remove(0, 1);
}
//If we can't find any ':' character, it means that this line is a
//internal message of syslogd
else {
process=i18n("none");
message=logLine;
}
QStringList list;
list.append(hostname);
list.append(process);
list.append(message);
/*
*TODO Try to avoid that 2 columns with the same timestamps (but not the
*same appearance order are not sorted correctly
*/
/*
LogLine* lastLine=buffers->lastLineInserted();
if (lastLine!=NULL) {
if (lastLine->getTime().date()==date && lastLine->getTime().time()==time)
time=time.addMSecs(1);
}
*/
QString filePath=originalFile->url.path();
LogLine* logLineObject=new LogLine(date, time, list, filePath, originalFile->level, Globals::noMode->id);
return(logLineObject);
}
QStringList* DefaultReader::getRawBuffer(QFile* file) {
kdDebug() << "Retrieving the raw buffer..." << endl;
QString buffer;
QString tmpBuffer;
QStringList* rawBuffer=new QStringList();
int res;
//Insert the content of the file in a string list
while(!file->atEnd()) {
//Read the first MaxCharactersRead characters
res=file->readLine(buffer, tmpMaxCharacters);
//Ignore the rest of the line
while(res==tmpMaxCharacters)
file->readLine(tmpBuffer, tmpMaxCharacters);
//Push the new buffer to the list
rawBuffer->push_back(buffer);
}
kdDebug() << "Raw buffer retrieved." << endl;
return(rawBuffer);
}
#include "defaultReader.moc"

@ -0,0 +1,82 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _DEFAULT_READER_H_
#define _DEFAULT_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qdatetime.h>
#include <kurl.h>
#include <kdebug.h>
#include "view.h"
#include "globals.h"
#include "reader.h"
#include "logLine.h"
#include "logLineList.h"
#include "logLineTree.h"
#include "logFile.h"
/**
* @author Nicolas Ternisien
*/
class DefaultReader : public Reader {
Q_OBJECT
public:
DefaultReader(QObject *parent = 0, const char *name = 0);
virtual ~DefaultReader();
virtual void readLog();
virtual void logChanged(LogFile* file);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* originalFile);
void readFile(LogFile* logFile);
virtual QStringList* getRawBuffer(QFile* file);
LogLineList* buffers;
bool tmpDeleteDuplicate;
bool tmpDeleteProcessId;
int tmpMaxLines;
int tmpMaxCharacters;
private:
//Returns false if the line has not been inserted
bool insertLine(QString& buffer, LogFile* originalFile);
//Returns false if the line has not been inserted
bool insertOrReplaceLine(QString& buffer, LogFile* originalFile);
};
#endif // _DEFAULT_READER_H_

@ -0,0 +1,242 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
//KDE includes
#include <kstdguiitem.h>
#include <ktextedit.h>
#include <kguiitem.h>
#include <kpushbutton.h>
#include <klocale.h>
#include <kdebug.h>
//Project includes
#include "parentLogLine.h"
#include "detailDialog.h"
DetailDialog::DetailDialog(View* v, QWidget *parent, const char *name) :
//KDialogBase(parent, name, false, i18n("Log Line Details"), 0 /*KDialogBase::Ok*/),
DetailDialogBase(parent, name, false, 0),
view(v),
currentLine(NULL) {
previous->setText(i18n("&Previous"));
connect(previous, SIGNAL(clicked()), this, SLOT(previousItem()));
next->setText(i18n("&Next"));
connect(next, SIGNAL(clicked()), this, SLOT(nextItem()));
//close->setText(KStdGuiItem::close().text());
//close->setIcon(KStdGuiItem::close().iconSet());
connect(closeButton, SIGNAL(clicked()), this, SLOT(closeDetails()));
updateDetails();
/* This code has been replaced by a pretty drawing of the Detail Dialog with Qt Designer
setMinimumHeight(200);
setMinimumWidth(450);
QWhatsThis::add(this, i18n("This dialog displays detailed information about the currently selected log line."));
QWidget* widget=new QWidget(this);
QVBoxLayout* mainLayout = new QVBoxLayout(widget, 0, 10);
QHBoxLayout* l1 = new QHBoxLayout(0, 0, 5);
icon=new QLabel(widget);
//icon->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
l1->addWidget(icon, 0, Qt::AlignVCenter);
//header=new KActiveLabel(widget, "header");
header=new QLabel(widget, "header");
//header->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Minimum) );
//header->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum ) );
l1->addWidget(header, 0, Qt::AlignVCenter || Qt::AlignHCenter);
mainLayout->addLayout(l1);
message=new QTextEdit(widget);
message->setReadOnly(true);
//message->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum) );
//message->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
//message->setMinimumHeight(40);
//message->setMinimumHeight(60);
//message->setMinimumWidth(400);
mainLayout->addWidget(message);
QHBoxLayout* buttons=new QHBoxLayout(0, 0, 10);
previous=new QPushButton(KStdGuiItem::back().iconSet(), i18n("&Previous"), widget);
connect(previous, SIGNAL(clicked()), this, SLOT(previousItem()));
//1=Stretch factor (ratio between object in the QHBoxLayout)
buttons->addWidget(previous, 1, Qt::AlignRight);
QToolTip::add(previous, i18n("Move to the previous line"));
QWhatsThis::add(previous, i18n("Moves to the previous line. This button is deactivated if there is no previous log line."));
buttons->setStretchFactor(previous, 1);
next=new QPushButton(KStdGuiItem::forward().iconSet(), i18n("&Next"), widget);
connect(next, SIGNAL(clicked()), this, SLOT(nextItem()));
//1=Stretch factor (ratio between object in the QHBoxLayout)
buttons->addWidget(next, 1, Qt::AlignLeft);
QToolTip::add(next, i18n("Move to the next line"));
QWhatsThis::add(next, i18n("Moves to the next line. This button is deactivated if there is no next log line."));
QPushButton* close=new QPushButton(KStdGuiItem::close().iconSet(), KStdGuiItem::close().text(), widget);
connect(close, SIGNAL(clicked()), this, SLOT(closeDetails()));
buttons->addWidget(close, 0, Qt::AlignRight);
QToolTip::add(next, i18n("Close the Detail dialog."));
QWhatsThis::add(next, i18n("Closes this Detail dialog."));
mainLayout->addLayout(buttons);
this->setMainWidget(widget);
//TODO Try to find a better solution (if it exists!)
//resize(500, 200);
*/
}
DetailDialog::~DetailDialog() {
}
void DetailDialog::setView(View* view) {
this->view=view;
updateDetails();
}
void DetailDialog::selectionChanged() {
updateDetails();
}
//TODO Try to find a method that reload (an resize) correctly the content of the detail dialog
void DetailDialog::updateDetails() {
//Get the current-last item selected
currentLine=view->getLastSelectedItem();
if (currentLine==NULL) {
//If no item are selected and the dialog is still open, we try to select the first
//item of the list.
currentLine=static_cast<LogListItem*> (view->getLogList()->firstChild());
if (currentLine==NULL) {
close();
return;
}
}
LogLine* logLine=currentLine->getLogLine();
//Special case if this is a ParentLogLine (Group By feature)
if (logLine->isParentLogLine()) {
icon->setPixmap(DesktopIcon(GROUP_BY_ICON));
header->setText(currentLine->getFormattedText());
message->setText("");
}
//Normal Log Line
else {
icon->setPixmap(DesktopIcon(logLine->getLogLevel()->icon));
header->setText(currentLine->getFormattedText());
message->setText(logLine->getItemList().last());
}
if (currentLine->itemAbove()==NULL)
previous->setEnabled(false);
else
previous->setEnabled(true);
if (currentLine->itemBelow()==NULL)
next->setEnabled(false);
else
next->setEnabled(true);
header->adjustSize();
this->adjustSize();
}
void DetailDialog::previousItem() {
//This case should not occurs
if (currentLine==NULL)
return;
//This case should not occurs
if (currentLine->itemAbove()==NULL) {
close();
return;
}
currentLine->setSelected(false);
currentLine->repaint();
currentLine=static_cast<LogListItem*> (currentLine->itemAbove());
currentLine->setSelected(true);
currentLine->repaint();
updateDetails();
}
void DetailDialog::closeDetails() {
this->close();
}
void DetailDialog::nextItem() {
//This case should not occurs
if (currentLine==NULL)
return;
//This case should not occurs
if (currentLine->itemBelow()==NULL) {
close();
return;
}
currentLine->setSelected(false);
currentLine->repaint();
currentLine=static_cast<LogListItem*> (currentLine->itemBelow());
currentLine->setSelected(true);
currentLine->repaint();
updateDetails();
}
#include "detailDialog.moc"

@ -0,0 +1,77 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _DETAIL_DIALOG_H_
#define _DETAIL_DIALOG_H_
#include <qwidget.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <kdialogbase.h>
#include <kactivelabel.h>
#include <kiconloader.h>
#include "detailDialogBase.h"
#include "view.h"
#include "logListItem.h"
class DetailDialog : public DetailDialogBase {
Q_OBJECT
public:
DetailDialog(View* v, QWidget *parent=NULL, const char* name=NULL);
~DetailDialog();
void setView(View* view);
public slots:
void selectionChanged();
protected slots:
void previousItem();
void closeDetails();
void nextItem();
private:
void updateDetails();
private:
//KActiveLabel* header;
/*
QLabel* header;
QTextEdit* message;
QLabel* icon;
QPushButton* previous;
QPushButton* next;
*/
View* view;
LogListItem* currentLine;
};
#endif //_DETAIL_DIALOG_H_

@ -0,0 +1,199 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>DetailDialogBase</class>
<widget class="QDialog">
<property name="name">
<cstring>detailDialog</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>411</width>
<height>248</height>
</rect>
</property>
<property name="caption">
<string>Log Line Details</string>
</property>
<property name="whatsThis" stdset="0">
<string>This dialog displays detailed information about the currently selected log line.</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="KTextEdit" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>message</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Message</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>icon</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Icon</string>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>header</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Main information</string>
</property>
</widget>
<widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>layout2</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="KPushButton">
<property name="name">
<cstring>previous</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Back</string>
</property>
<property name="accel">
<string>Alt+B</string>
</property>
<property name="stdItem" stdset="0">
<number>14</number>
</property>
<property name="toolTip" stdset="0">
<string>Move to the previous line</string>
</property>
<property name="whatsThis" stdset="0">
<string>Moves to the previous line. This button is deactivated if there is no previous log line.</string>
</property>
</widget>
<widget class="KPushButton">
<property name="name">
<cstring>next</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Forward</string>
</property>
<property name="accel">
<string>Alt+F</string>
</property>
<property name="stdItem" stdset="0">
<number>15</number>
</property>
<property name="toolTip" stdset="0">
<string>Move to the next line</string>
</property>
<property name="whatsThis" stdset="0">
<string>Moves to the next line. This button is deactivated if there is no next log line.</string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer1</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>100</width>
<height>31</height>
</size>
</property>
</spacer>
<widget class="KPushButton">
<property name="name">
<cstring>closeButton</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Close</string>
</property>
<property name="accel">
<string>Alt+C</string>
</property>
<property name="stdItem" stdset="0">
<number>13</number>
</property>
<property name="toolTip" stdset="0">
<string>Close the Detail dialog.</string>
</property>
<property name="whatsThis" stdset="0">
<string>Closes this Detail dialog.</string>
</property>
</widget>
</hbox>
</widget>
</grid>
</widget>
<tabstops>
<tabstop>message</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="8"/>
<includehints>
<includehint>ktextedit.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
</includehints>
</UI>

@ -0,0 +1,277 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "fileList.h"
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qwhatsthis.h>
#include <qtooltip.h>
// KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
FileList::FileList(QWidget *parent, QString description) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QVGroupBox* dirBox = new QVGroupBox(i18n( "Files" ), this);
QLabel *defaultPathLabel = new QLabel(description, dirBox);
defaultPathLabel->setTextFormat(RichText);
QHBox* center= new QHBox(dirBox);
center->setSpacing(10);
fileList=new KListBox(center);
buttons=new QVBox(center);
fileList->setSelectionMode(QListBox::Extended);
QToolTip::add(fileList, i18n("List of files used by this log type"));
QWhatsThis::add(fileList, i18n("<qt>Here is a list of every files that will be read by KSystemLog to display the current log lines.</qt>"));
add=new QPushButton(SmallIcon("fileopen"), i18n("&Add File..."), buttons);
connect(add, SIGNAL(clicked()), this, SLOT(addItem()));
QToolTip::add(add, i18n("Choose a new file"));
QWhatsThis::add(add, i18n("Opens a dialog box to choose a new file to be added to the list."));
remove=new QPushButton(SmallIconSet("edit_remove"), i18n("&Remove"), buttons);
connect(remove, SIGNAL(clicked()), this, SLOT(removeSelectedItem()));
QToolTip::add(remove, i18n("Delete the current file(s)"));
QWhatsThis::add(remove, i18n("Deletes the selected files of the list."));
up=new QPushButton(SmallIconSet("up"), i18n("Move &Up"), buttons);
connect(up, SIGNAL(clicked()), this, SLOT(moveUpItem()));
QToolTip::add(up, i18n("Move up the current file(s)"));
QWhatsThis::add(up, i18n("<qt>Moves up the selected files in the list. This option allows the files to be read <b>in first</b> by KSystemLog.</qt>"));
down=new QPushButton(SmallIconSet("down"), i18n("Move &Down"), buttons);
connect(down, SIGNAL(clicked()), this, SLOT(moveDownItem()));
QToolTip::add(down, i18n("Move down the current file(s)"));
QWhatsThis::add(down, i18n("<qt>Moves down the selected files in the list. This option allows the files to be read <b>at last</b> by KSystemLog.</qt>"));
removeAll=new QPushButton(SmallIconSet("cancel"), i18n("Re&move All"), buttons);
connect(removeAll, SIGNAL(clicked()), this, SLOT(removeAllItem()));
QToolTip::add(removeAll, i18n("Remove all files"));
QWhatsThis::add(removeAll, i18n("<qt>Remove all files of the list, even if they are not selected.</qt>"));
fileListMenu=new KPopupMenu(this);
fileListMenu->insertTitle(i18n("File List"));
fileListMenu->insertItem(SmallIcon("fileopen"), i18n("&Add File..."), this, SLOT(addItem()), 0, ADD_FILE_MENU_ID);
fileListMenu->insertItem(SmallIcon("edit_remove"), i18n("&Remove"), this, SLOT(removeSelectedItem()), 0, REMOVE_MENU_ID);
fileListMenu->insertSeparator();
fileListMenu->insertItem(SmallIcon("up"), i18n("Move &Up"), this, SLOT(moveUpItem()), 0, MOVE_UP_MENU_ID);
fileListMenu->insertItem(SmallIcon("down"), i18n("Move &Down"), this, SLOT(moveDownItem()), 0, MOVE_DOWN_MENU_ID);
fileListMenu->insertSeparator();
fileListMenu->insertItem(SmallIcon("cancel"), i18n("Re&move All"), this, SLOT(removeAllItem()), 0, REMOVE_ALL_MENU_ID);
connect(fileList, SIGNAL(selectionChanged()), this, SLOT(updateButtons()));
connect(this, SIGNAL(fileListChanged(int)), this, SLOT(updateButtons()));
connect(fileList, SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint &)), this, SLOT(displayPopupMenu(QListBoxItem*, const QPoint&)));
updateButtons();
}
FileList::~FileList() {
}
QString FileList::getText(int i) {
return(fileList->text(i));
}
void FileList::insertItem(QString& item) {
fileList->insertItem(item);
}
int FileList::count() {
return(fileList->count());
}
void FileList::displayPopupMenu(QListBoxItem*, const QPoint& point) {
fileListMenu->popup(point);
}
void FileList::addItem() {
//Open a standard Filedialog
KURL::List urlList;
urlList=KFileDialog::getOpenURLs(DEFAULT_FOLDER, "*|" + i18n("All Files (*)") + "\n*.log|" + i18n("Log Files (*.log)"), this, i18n("Choose Log File"));
KURL url;
KURL::List::iterator it;
for(it=urlList.begin(); it!=urlList.end(); ++it) {
url=*it;
if (isValidFile(url)) {
fileList->insertItem(url.path());
}
}
emit fileListChanged(fileList->count());
}
bool FileList::isValidFile(KURL url) {
QString message;
//If it is not valid
if (!url.isValid()) {
message=i18n("'%1' is not valid.").arg(url.path());
KMessageBox::error(this, message, i18n("File selection failed"), KMessageBox::Notify);
return(false);
}
//If it is not a local file
if (!url.isLocalFile()) {
message=i18n("'%1' is not a local file.").arg(url.path());
KMessageBox::error(this, message, i18n("File selection failed"), KMessageBox::Notify);
return(false);
}
//If it's a directory, it's not valid
if (QDir(url.path()).exists()) {
message=i18n("'%1' is a folder.").arg(url.path());
KMessageBox::error(this, message, i18n("File selection failed"), KMessageBox::Notify);
return(false);
}
return(true);
}
void FileList::removeItem(int id) {
fileList->removeItem(id);
}
void FileList::removeSelectedItem() {
for (int i=0; i<(int) fileList->count(); i++) {
if (fileList->isSelected(i)==true) {
this->removeItem(i);
i--;
}
}
fileList->setSelected(fileList->count()-1, true);
fileList->setCurrentItem(fileList->count()-1);
emit fileListChanged(fileList->count());
}
void FileList::moveUpItem() {
int count=fileList->count();
QListBoxItem* item;
int index;
for (int i=1; i<count; i++) {
if (fileList->isSelected(i)==true && fileList->isSelected(i-1)==false) {
item=fileList->item(i);
fileList->takeItem(item);
fileList->insertItem(item, i-1);
index=fileList->index(item);
fileList->setSelected(index, true);
fileList->setCurrentItem(index);
}
}
emit fileListChanged(count);
}
void FileList::moveDownItem() {
int count=fileList->count();
QListBoxItem* item;
int index;
for (int i=count-2; i>=0; i--) {
if (fileList->isSelected(i)==true && fileList->isSelected(i+1)==false) {
item=fileList->item(i);
fileList->takeItem(item);
fileList->insertItem(item, i+1);
index=fileList->index(item);
fileList->setSelected(index, true);
fileList->setCurrentItem(index);
}
}
emit fileListChanged(count);
}
void FileList::removeAllItem() {
int count=fileList->count();
for (int i=0; i<count; i++) {
this->removeItem(0);
}
emit fileListChanged(0);
}
bool FileList::updateButtons() {
int count=fileList->count();
if (count==0)
removeAll->setEnabled(false);
else
removeAll->setEnabled(true);
bool selection=false;
for (int i=0; i<count; i++) {
if (fileList->isSelected(i)==true) {
selection=true;
}
}
//If nothing is selected, disabled special buttons
remove->setEnabled(selection);
up->setEnabled(selection);
down->setEnabled(selection);
return(selection);
}
#include "fileList.moc"

@ -0,0 +1,90 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _FILE_LIST_H_
#define _FILE_LIST_H_
#include <qvbox.h>
#include <qpushbutton.h>
#include <kpopupmenu.h>
#include <klistbox.h>
#include "globals.h"
#include "logLevel.h"
#define ADD_FILE_MENU_ID 0
#define REMOVE_MENU_ID 1
#define MOVE_UP_MENU_ID 2
#define MOVE_DOWN_MENU_ID 3
#define REMOVE_ALL_MENU_ID 4
//TODO Maybe draw this class with Qt Designer
class FileList : public QWidget {
Q_OBJECT
public:
FileList(QWidget *parent, QString description);
~FileList();
virtual void insertItem(QString& item);
virtual void removeItem(int id);
void insertItem(QPixmap& pixmap, QString& item);
int count();
QString getText(int i);
signals:
void fileListChanged(int itemLeft);
protected slots:
virtual bool updateButtons();
void removeSelectedItem();
void moveUpItem();
void moveDownItem();
void removeAllItem();
virtual void addItem();
void displayPopupMenu(QListBoxItem* item, const QPoint& point);
protected:
bool isValidFile(KURL url);
QVBox* buttons;
KPopupMenu* fileListMenu;
KListBox* fileList;
private:
QPushButton* add;
QPushButton* remove;
QPushButton* up;
QPushButton* down;
QPushButton* removeAll;
};
#endif //_FILE_LIST_H_

@ -0,0 +1,208 @@
//
// C++ Implementation: findManager
//
// Description:
//
//
// Author: Nicolas Ternisien <nicolas.ternisien@gmail.com>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
//Project includes
#include "findManager.h"
#include "ksystemlog.h"
FindManager::FindManager(KSystemLog* parent, const char* name) :
QObject(parent, name),
main(parent),
findDialog(NULL),
findManager(NULL),
previousItemFound(NULL),
currentItemFound(NULL) {
}
FindManager::~FindManager() {
if (findDialog!=NULL)
delete findDialog;
if (findManager!=NULL)
delete findManager;
}
void FindManager::slotFind() {
if (findManager!=NULL) {
delete findManager;
findManager=NULL;
}
if (findDialog==NULL) {
kdDebug() << "KFindDialog creation" << endl;
//TODO Save the Find options to Config file
findDialog=new KFindDialog(false, main, "find_dialog");
connect(findDialog, SIGNAL(okClicked()), this, SLOT(slotFindNext()));
findDialog->show();
}
else {
findDialog->show();
//KWin::activateWindow(findDialog->winId());
//return;
}
}
void FindManager::slotFirstFind() {
kdDebug() << "First Find" << endl;
LogManager* currentManager=main->activeLogManager();
KListView* list=currentManager->getView()->getLogList();
//Delete the previous KFind object (if it exists)
if (findManager!=NULL) {
delete findManager;
findManager=NULL;
}
//TODO Is useful?
if (previousItemFound!=NULL) {
list->setSelected(previousItemFound, false);
}
//This creates a find-next-prompt dialog if needed.
findManager=new KFind(findDialog->pattern(), findDialog->options(), main, findDialog);
connect(findManager, SIGNAL(highlight(const QString&, int, int)), this, SLOT(highlightSearch(const QString&, int, int)));
connect(findManager, SIGNAL(findNext()), this, SLOT(slotFindNext()));
//Do not keep the KFindDialog open
findDialog->hide();
//findManager->closeFindNextDialog();
QListViewItemIterator it(list, QListViewItemIterator::Selected);
int itemPos=-1;
int currentPos;
while (it.current()) {
list->setSelected(it.current(), false);
currentPos=list->itemPos(it.current());
if (currentPos>=itemPos) {
itemPos=currentPos;
previousItemFound=static_cast<LogListItem*> (it.current());
}
++it;
}
//Unselect all previous items (the last one if always selected)
if (previousItemFound!=NULL)
list->setSelected(previousItemFound, true);
//If we search from the cursor, the iterator goes to the first selected item
if (findDialog->options() & KFindDialog::FromCursor) {
currentItemFound=currentManager->getView()->getFirstSelectedItem();
//If nothing is selected, then we initialize the iterator classicaly
if (currentItemFound==NULL) {
currentItemFound=static_cast<LogListItem*> (list->firstChild());
}
previousItemFound=currentItemFound;
}
//If we search from the last, the iterator is initialized to the last item
else if (findDialog->options() & KFindDialog::FindBackwards) {
currentItemFound=static_cast<LogListItem*> (list->lastItem());
}
//Default initialization
else {
currentItemFound=static_cast<LogListItem*> (list->firstChild());
}
}
void FindManager::slotFindNext() {
//If we attempt to go to the next search, without have opened the find dialog, we open it
if (findDialog==NULL) {
slotFind();
return;
}
//If the KFind object has not been initialized, we call the right method for that
if (findManager==NULL) {
slotFirstFind();
}
//Keep the Find Dialog opened
/*
if (findManager->options() != findDialog->options() || findManager->pattern()!=findDialog->pattern()) {
kdDebug() << "Reinitialize the search..." << endl;
slotFirstFind();
}
*/
KFind::Result res = KFind::NoMatch;
while (res==KFind::NoMatch && currentItemFound!=NULL) {
//Always need new data, because a line is only selected one time
//if (findManager->needData())
findManager->setData(currentItemFound->exportToText());
//Let KFind inspect the text fragment, and display a dialog if a match is found
res=findManager->find();
//Always need new data, because a line is only selected one time
//if (res==KFind::NoMatch ) {
if (findDialog->options() & KFindDialog::FindBackwards)
currentItemFound=static_cast<LogListItem*> (currentItemFound->itemAbove());
else
currentItemFound=static_cast<LogListItem*> (currentItemFound->itemBelow());
//}
}
//End of the view
if (res==KFind::NoMatch) {
if (findManager->shouldRestart()) {
delete findManager;
findManager=NULL;
findDialog->setOptions(findDialog->options() & !KFindDialog::FromCursor);
slotFindNext();
}
else {
findManager->closeFindNextDialog();
}
}
}
void FindManager::highlightSearch(const QString& /*text*/, int /*matchingIndex*/, int /*matchingLength*/) {
LogManager* currentManager=main->activeLogManager();
KListView* list=currentManager->getView()->getLogList();
if (previousItemFound!=NULL) {
list->setSelected(previousItemFound, false);
}
if (currentItemFound!=NULL) {
list->setSelected(currentItemFound, true);
list->ensureItemVisible(currentItemFound);
previousItemFound=currentItemFound;
}
}
#include "findManager.moc"

@ -0,0 +1,81 @@
//
// C++ Interface: findManager
//
// Description:
//
//
// Author: Nicolas Ternisien <nicolas.ternisien@gmail.com>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef FIND_MANAGER_H
#define FIND_MANAGER_H
//Qt includes
#include <qobject.h>
//KDE includes
#include <kfinddialog.h>
#include <kfind.h>
#include <kdeversion.h>
//Project includes
#include "logManager.h"
#include "globals.h"
class KSystemLog;
/**
*
* @short Find Manager
* @author Nicolas Ternisien <nicolas.ternisien@gmail.com>
* @version 0.1
*/
class FindManager : public QObject {
Q_OBJECT
public:
/**
* Default Constructor
*/
FindManager(KSystemLog* parent, const char* name);
virtual ~FindManager();
public slots:
void slotFind();
void slotFindNext();
void slotFirstFind();
void highlightSearch(const QString& text, int matchingIndex, int matchingLength);
private:
KSystemLog* main;
/**
* A pointer to the Find dialog
*/
KFindDialog* findDialog;
/**
* The manager of the current search
*/
KFind* findManager;
/**
* Previous object found
*/
LogListItem* previousItemFound;
/**
* Current object found
*/
LogListItem* currentItemFound;
};
#endif

@ -0,0 +1,143 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <qlayout.h>
#include <qlabel.h>
#include <qvgroupbox.h>
#include <qbutton.h>
#include <qradiobutton.h>
#include <qwhatsthis.h>
#include <qtooltip.h>
#include <klocale.h>
#include <kdialogbase.h>
#include <kiconloader.h>
#include <kapplication.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include "ksystemlogConfig.h"
#include "generalOptions.h"
GeneralOptions::GeneralOptions(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(10);
//Maximum Lines
QVGroupBox* logLinesBox=new QVGroupBox(i18n("Log Lines List"), this);
new QLabel(i18n("Maximum lines displayed:"), logLinesBox);
maxLines=new QSpinBox(10, 30000, 10, logLinesBox);
connect(maxLines, SIGNAL(valueChanged(int)), this, SLOT(onOptionsChanged()));
QToolTip::add(maxLines, i18n("<qt>Choose here the maximum number of log lines displayed in the main view.</qt>"));
QWhatsThis::add(maxLines, i18n("<qt>You can choose here the maximum number of log lines displayed in the main view.</qt>"));
deleteDuplicatedLines=new QCheckBox(i18n("Delete duplicated log lines (may be slow)"), logLinesBox);
connect(deleteDuplicatedLines, SIGNAL(clicked()), this, SLOT(onOptionsChanged()));
QToolTip::add(deleteDuplicatedLines, i18n("<qt>Select this option if you want to delete duplicated log lines <b>(may be slow)</b>.</qt>"));
QWhatsThis::add(deleteDuplicatedLines, i18n("<qt>You can select this option if you want to delete duplicated log lines. <b>This option can slow the reading</b>.</qt>"));
//Maximum Characters per line
QVGroupBox* maxCharBox=new QVGroupBox(i18n("Maximum Characters to Read per Line"), this);
new QLabel(i18n("Number of characters:"), maxCharBox);
maxCharacters=new QSpinBox(10, 30000, 10, maxCharBox);
connect(maxCharacters, SIGNAL(valueChanged(int)), this, SLOT(onOptionsChanged()));
QToolTip::add(maxCharacters, i18n("<qt>Choose here the maximum number of characters to read from each log line.</qt>"));
QWhatsThis::add(maxCharacters, i18n("<qt>You can choose here the maximum number of characters to read from each log line.</qt>"));
QVGroupBox* options= new QVGroupBox( i18n( "Options" ), this );
deleteProcessId=new QCheckBox(i18n("Delete process identifier from process name"), options);
connect(deleteProcessId, SIGNAL(clicked()), this, SLOT(onOptionsChanged()));
QToolTip::add(deleteProcessId, i18n("<qt>Delete process identifier from process name.</qt>"));
QWhatsThis::add(deleteProcessId, i18n("<qt>You can select this option if you want to delete the process identifier from process name. For example, you will sometimes see in the <b>Process</b> column something like <i>cron<b>[3433]</b></i>. If this option is activated, the annoying bold part will be erased.</qt>"));
colorizeLogLines=new QCheckBox(i18n("Colorize log lines"), options);
connect(colorizeLogLines, SIGNAL(clicked()), this, SLOT(onOptionsChanged()));
QToolTip::add(colorizeLogLines, i18n("<qt>This option allows the colorization of log lines, depending on their log level.</qt>"));
QWhatsThis::add(colorizeLogLines, i18n("<qt>This option allows the colorization of log lines, depending on their log level. For example, an error will be in red, a warning in orange... This will help you to better see problems.</qt>"));
QSpacerItem* spacer=new QSpacerItem(0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding);
layout->addWidget(logLinesBox);
layout->addWidget(maxCharBox);
layout->addWidget(options);
layout->addItem(spacer);
readConfig();
}
void GeneralOptions::readConfig() {
int value;
value=KSystemLogConfig::maxLines();
maxLines->setValue(value);
value=KSystemLogConfig::maxReadCharacters();
maxCharacters->setValue(value);
bool option=KSystemLogConfig::deleteDuplicatedLines();
deleteDuplicatedLines->setChecked(option);
option=KSystemLogConfig::deleteProcessIdentifier();
deleteProcessId->setChecked(option);
option=KSystemLogConfig::colorizeLogLines();
colorizeLogLines->setChecked(option);
}
void GeneralOptions::saveConfig() {
kdDebug() << "Save config from General preferences" << endl;
KSystemLogConfig::setMaxLines(maxLines->value());
KSystemLogConfig::setMaxReadCharacters(maxCharacters->value());
KSystemLogConfig::setDeleteDuplicatedLines(deleteDuplicatedLines->isChecked());
KSystemLogConfig::setDeleteProcessIdentifier(deleteProcessId->isChecked());
KSystemLogConfig::setColorizeLogLines(colorizeLogLines->isChecked());
}
bool GeneralOptions::isValid() {
return(maxLines->value()>0 && maxCharacters->value()>0);
}
void GeneralOptions::onOptionsChanged() {
emit optionsChanged(true);
}
#include "generalOptions.moc"

@ -0,0 +1,61 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _GENERAL_OPTIONS_H_
#define _GENERAL_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include "globals.h"
class GeneralOptions : public QWidget {
Q_OBJECT
public:
GeneralOptions(QWidget *parent = 0);
bool isValid();
public slots:
void saveConfig();
void readConfig();
signals:
void optionsChanged(bool valid);
private slots:
void onOptionsChanged();
private:
QSpinBox* maxLines;
QSpinBox* maxCharacters;
QCheckBox* deleteDuplicatedLines;
QCheckBox* deleteProcessId;
QCheckBox* colorizeLogLines;
};
#endif // _GENERAL_PREFERENCES_H_

@ -0,0 +1,148 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "globals.h"
#include <klocale.h>
#include "logLevel.h"
#include "logMode.h"
//Existing Log levels. The id value corresponds to the index in the vector
LogLevels Globals::logLevels;
LogLevel* Globals::noneLogLevel=NULL;
LogLevel* Globals::debugLogLevel=NULL;
LogLevel* Globals::informationLogLevel=NULL;
LogLevel* Globals::noticeLogLevel=NULL;
LogLevel* Globals::warningLogLevel=NULL;
LogLevel* Globals::errorLogLevel=NULL;
LogLevel* Globals::criticalLogLevel=NULL;
LogLevel* Globals::alertLogLevel=NULL;
LogLevel* Globals::emergencyLogLevel=NULL;
void Globals::setupLogLevels() {
Globals::noneLogLevel=new LogLevel(NONE_LOG_LEVEL_ID, i18n("none"), NONE_LOG_LEVEL_ICON, QColor(208, 210, 220));
Globals::logLevels.append(Globals::noneLogLevel);
Globals::debugLogLevel=new LogLevel(DEBUG_LOG_LEVEL_ID, i18n("debug"), DEBUG_LOG_LEVEL_ICON, QColor(156, 157, 165));
Globals::logLevels.append(debugLogLevel);
Globals::informationLogLevel=new LogLevel(INFORMATION_LOG_LEVEL_ID, i18n("information"), INFORMATION_LOG_LEVEL_ICON, QColor(36, 49, 103) /*QColor(0, 0, 0)*/);
Globals::logLevels.append(Globals::informationLogLevel);
Globals::noticeLogLevel=new LogLevel(NOTICE_LOG_LEVEL_ID, i18n("notice"), NOTICE_LOG_LEVEL_ICON, QColor(36, 138, 22));
Globals::logLevels.append(Globals::noticeLogLevel);
Globals::warningLogLevel=new LogLevel(WARNING_LOG_LEVEL_ID, i18n("warning"), WARNING_LOG_LEVEL_ICON, QColor(238, 144, 21));
Globals::logLevels.append(Globals::warningLogLevel);
Globals::errorLogLevel=new LogLevel(ERROR_LOG_LEVEL_ID, i18n("error"), ERROR_LOG_LEVEL_ICON, QColor(173, 28, 28));
Globals::logLevels.append(Globals::errorLogLevel);
Globals::criticalLogLevel=new LogLevel(CRITICAL_LOG_LEVEL_ID, i18n("critical"), CRITICAL_LOG_LEVEL_ICON, QColor(214, 26, 26));
Globals::logLevels.append(criticalLogLevel);
Globals::alertLogLevel=new LogLevel(ALERT_LOG_LEVEL_ID, i18n("alert"), ALERT_LOG_LEVEL_ICON, QColor(214, 0, 0));
Globals::logLevels.append(alertLogLevel);
Globals::emergencyLogLevel=new LogLevel(EMERGENCY_LOG_LEVEL_ID, i18n("emergency"), EMERGENCY_LOG_LEVEL_ICON, QColor(255, 0, 0));
Globals::logLevels.append(emergencyLogLevel);
}
LogModes Globals::logModes;
LogMode* Globals::noMode=NULL;
LogMode* Globals::openingMode=NULL;
LogMode* Globals::systemMode=NULL;
LogMode* Globals::kernelMode=NULL;
LogMode* Globals::xorgMode=NULL;
LogMode* Globals::bootMode=NULL;
LogMode* Globals::authenticationMode=NULL;
LogMode* Globals::cronMode=NULL;
LogMode* Globals::daemonMode=NULL;
LogMode* Globals::acpidMode=NULL;
LogMode* Globals::cupsMode=NULL;
LogMode* Globals::cupsAccessMode=NULL;
LogMode* Globals::apacheMode=NULL;
LogMode* Globals::apacheAccessMode=NULL;
LogMode* Globals::postfixMode=NULL;
LogMode* Globals::sambaMode=NULL;
void Globals::setupLogModes() {
int i=0;
Globals::noMode=new LogMode(i++, i18n("No Log"), NO_MODE_ICON);
Globals::logModes.append(noMode);
Globals::openingMode=new LogMode(i++, i18n("File Log"), OPENING_MODE_ICON);
Globals::logModes.append(openingMode);
Globals::systemMode=new LogMode(i++, i18n("System Log"), SYSTEM_MODE_ICON);
Globals::logModes.append(systemMode);
Globals::kernelMode=new LogMode(i++, i18n("Kernel Log"), KERNEL_MODE_ICON);
Globals::logModes.append(kernelMode);
Globals::xorgMode=new LogMode(i++, i18n("X.org Log"), XORG_MODE_ICON);
Globals::logModes.append(xorgMode);
Globals::sambaMode=new LogMode(i++, i18n("Samba Log"), SAMBA_MODE_ICON);
Globals::logModes.append(sambaMode);
Globals::bootMode=new LogMode(i++, i18n("Boot Log"), BOOT_MODE_ICON);
Globals::logModes.append(bootMode);
Globals::authenticationMode=new LogMode(i++, i18n("Authentication Log"), AUTHENTICATION_MODE_ICON);
Globals::logModes.append(authenticationMode);
Globals::cronMode=new LogMode(i++, i18n("Cron Log"), CRON_MODE_ICON);
Globals::logModes.append(cronMode);
Globals::daemonMode=new LogMode(i++, i18n("Daemon Log"), DAEMON_MODE_ICON);
Globals::logModes.append(daemonMode);
Globals::acpidMode=new LogMode(i++, i18n("ACPI Log"), ACPID_MODE_ICON);
Globals::logModes.append(acpidMode);
Globals::cupsMode=new LogMode(i++, i18n("CUPS Log"), CUPS_MODE_ICON);
Globals::logModes.append(cupsMode);
Globals::cupsAccessMode=new LogMode(i++, i18n("CUPS Access Log"), CUPS_ACCESS_MODE_ICON);
Globals::logModes.append(cupsAccessMode);
Globals::apacheMode=new LogMode(i++, i18n("Apache Log"), APACHE_MODE_ICON);
Globals::logModes.append(apacheMode);
Globals::apacheAccessMode=new LogMode(i++, i18n("Apache Access Log"), APACHE_ACCESS_MODE_ICON);
Globals::logModes.append(apacheAccessMode);
Globals::postfixMode=new LogMode(i++, i18n("Postfix Log"), POSTFIX_MODE_ICON);
Globals::logModes.append(postfixMode);
Globals::sambaMode=new LogMode(i++, i18n("Samba Log"), SAMBA_MODE_ICON);
Globals::logModes.append(sambaMode);
}

@ -0,0 +1,184 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _GLOBALS_H_
#define _GLOBALS_H_
#include <qptrlist.h>
#include <qstring.h>
//Redefined here to compile correctly (crossed-header problem)
class LogLevel;
typedef QPtrList<LogLevel> LogLevels;
//Redefined here to compile correctly (crossed-header problem)
class LogMode;
typedef QPtrList<LogMode> LogModes;
#define DEFAULT_FOLDER "/var/log"
/**
* Icon name of KSystemLog
*/
#define KSYSTEMLOG_ICON "ksystemlog"
// String was "none"
#define NONE_LOG_LEVEL_ICON "help"
#define DEBUG_LOG_LEVEL_ICON "attach"
#define INFORMATION_LOG_LEVEL_ICON "messagebox_info"
#define NOTICE_LOG_LEVEL_ICON "endturn"
#define WARNING_LOG_LEVEL_ICON "messagebox_warning"
#define ERROR_LOG_LEVEL_ICON "messagebox_critical"
#define CRITICAL_LOG_LEVEL_ICON "core"
#define ALERT_LOG_LEVEL_ICON "kalarm"
#define EMERGENCY_LOG_LEVEL_ICON "exit"
enum logLevelIds {
NONE_LOG_LEVEL_ID=0,
DEBUG_LOG_LEVEL_ID,
INFORMATION_LOG_LEVEL_ID,
NOTICE_LOG_LEVEL_ID,
WARNING_LOG_LEVEL_ID,
ERROR_LOG_LEVEL_ID,
CRITICAL_LOG_LEVEL_ID,
ALERT_LOG_LEVEL_ID,
EMERGENCY_LOG_LEVEL_ID,
};
enum groupByType {
NO_GROUP_BY=0,
GROUP_BY_LOG_LEVEL,
GROUP_BY_DAY,
GROUP_BY_HOUR,
GROUP_BY_LOG_FILE,
GROUP_BY_COLUMN
};
//This variable only counts GROUP_BY methods != than GROUP_BY_COLUMN
#define DEFAULT_GROUP_BY_COUNT 5
#define NO_GROUP_BY_ICON "cancel"
#define GROUP_BY_LOG_LEVEL_ICON INFORMATION_LOG_LEVEL_ICON
#define GROUP_BY_DAY_ICON "today"
#define GROUP_BY_HOUR_ICON "clock"
#define GROUP_BY_LOG_FILE_ICON "file"
#define GROUP_BY_COLUMN_ICON "view_text"
//Icon of the Group By action
#define GROUP_BY_ICON "view_tree"
/**
* Icon names of different existing modes
*/
#define NO_MODE_ICON "ksystemlog"
#define OPENING_MODE_ICON "file"
#define SYSTEM_MODE_ICON "hwinfo"
#define KERNEL_MODE_ICON "openterm"
#define XORG_MODE_ICON "x"
#define BOOT_MODE_ICON "system"
#define AUTHENTICATION_MODE_ICON "kuser"
#define DAEMON_MODE_ICON "misc"
#define CRON_MODE_ICON "history"
#define SAMBA_MODE_ICON "samba"
#define PROFTP_MODE_ICON "ftp"
#define ACPID_MODE_ICON "connect_no"
#define CUPS_MODE_ICON "fileprint"
#define CUPS_ACCESS_MODE_ICON "history"
#define APACHE_MODE_ICON "network"
#define APACHE_ACCESS_MODE_ICON "history"
#define POSTFIX_MODE_ICON "email"
#define SAMBA_MODE_ICON "samba"
class Globals {
public:
static void setupLogModes();
static void setupLogLevels();
/**
* Existing Log modes. The id value corresponds to the index in the vector
*/
static LogModes logModes;
/**
* These value are only pointers to item of the previous vector,
* they are provided for convenience
*/
static LogMode* noMode;
static LogMode* openingMode;
static LogMode* systemMode;
static LogMode* kernelMode;
static LogMode* xorgMode;
static LogMode* bootMode;
static LogMode* authenticationMode;
static LogMode* cronMode;
static LogMode* daemonMode;
static LogMode* acpidMode;
static LogMode* cupsMode;
static LogMode* cupsAccessMode;
static LogMode* apacheMode;
static LogMode* apacheAccessMode;
static LogMode* postfixMode;
static LogMode* sambaMode;
/**
* Existing Log levels. The id value corresponds to the index in the vector
*/
static LogLevels logLevels;
/**
* These value are only pointers to item of the previous vector,
* they are provided for convenience
*/
static LogLevel* noneLogLevel;
static LogLevel* debugLogLevel;
static LogLevel* informationLogLevel;
static LogLevel* noticeLogLevel;
static LogLevel* warningLogLevel;
static LogLevel* errorLogLevel;
static LogLevel* criticalLogLevel;
static LogLevel* alertLogLevel;
static LogLevel* emergencyLogLevel;
};
#endif

@ -0,0 +1,494 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//KDE includes
#include <kdebug.h>
#include <kiconloader.h>
#include <klocale.h>
//KSystemLog includes
#include "logLine.h"
#include "childLogLine.h"
#include "parentLogLine.h"
#include "logListItem.h"
#include "logMode.h"
#include "itemFactory.h"
LogListItem* ItemFactory::createLogListItem(QListView* view, LogLine* line) {
//If it is a parent Log Line
if (line->isParentLogLine()==true)
return(createParentItem(view, (ParentLogLine*)line));
//If it's a child Log Line
if (line->isChildLogLine()==true)
return(createChildItem(view, (ChildLogLine*)line));
/*
//If it's a Samba mode item
if (line->getType()==Globals::sambaMode->id) {
kdDebug() << "Samba... Di Janero!!" << endl;
LogListItem* item=createBasicItem(view, line);
item->setMultiLinesEnabled(true);
}
*/
//It's a normal Log Line
return(createBasicItem(view, line));
}
LogListItem* ItemFactory::createParentItem(QListView* view, ParentLogLine* line) {
//kdDebug() << "Creating a parent item : " << line->getLogLevel()->name << endl;
LogListItem* item=new LogListItem(view, line);
//item->setExpandable(true);
//Group by Log Level
if (line->getGroupBy()==GROUP_BY_LOG_LEVEL) {
item->setText(0, line->getLogLevel()->name);
item->setPixmap(0, line->getLogLevel()->pixmap);
if (line->getLogLevel()==Globals::informationLogLevel) {
item->setOpen(true);
view->ensureItemVisible(item);
}
else {
item->setOpen(false);
}
}
//Group by Day
else if (line->getGroupBy()==GROUP_BY_DAY) {
//TODO Move these tests to a dedicated static method (to be able to reuse it)
QDate today=QDate::currentDate();
QDate yesterday=today.addDays(-1);
QDate date=line->getTime().date();
if (date==today) {
item->setText(0, i18n("Today"));
item->setOpen(true);
view->ensureItemVisible(item);
}
else if (date==yesterday) {
item->setText(0, i18n("Yesterday"));
item->setOpen(false);
}
else {
item->setText(0, date.toString());
item->setOpen(false);
}
item->setPixmap(0, SmallIcon(GROUP_BY_DAY_ICON));
}
//Group by Hour
else if (line->getGroupBy()==GROUP_BY_HOUR) {
QString string(i18n("%1, %2h").arg(line->getTime().date().toString(), line->getTime().time().toString("h")));
item->setText(0, string);
item->setPixmap(0, SmallIcon(GROUP_BY_HOUR_ICON));
QDate today=QDate::currentDate();
QTime time=QTime::currentTime();
if (line->getTime().date()==today && line->getTime().time().hour()==time.hour()) {
kdDebug() << "Date equals, hour equals" << line->getTime().date().toString() << " and " << line->getTime().time().toString() << endl;
item->setOpen(true);
view->ensureItemVisible(item);
}
else {
item->setOpen(false);
}
}
//Group by Day
else if (line->getGroupBy()==GROUP_BY_LOG_FILE) {
item->setText(0, line->getOriginalFile());
item->setPixmap(0, SmallIcon(GROUP_BY_LOG_FILE_ICON));
}
//Group by a specific column
else {
int index=ParentLogLine::getGroupedColumnIndex(line->getColumns(), line->getGroupByColumn());
QStringList& list=line->getItemList();
if (index<0 || index>=(int)list.size())
item->setText(0, i18n("none"));
else
item->setText(0, list[index]);
item->setPixmap(0, SmallIcon(GROUP_BY_COLUMN_ICON));
}
return(item);
}
LogListItem* ItemFactory::createChildItem(QListView* /*view*/, ChildLogLine* line) {
LogListItem* parent=line->getParent()->getLogListItem();
if (parent==NULL)
kdDebug() << "Parent log list item NULL !!!" << endl;
//kdDebug() << "The log level of the parent is " << parent->getLogLine()->getLogLevel()->name << endl;
LogListItem* item=new LogListItem(parent, line);
initItem(item);
return(item);
}
LogListItem* ItemFactory::createBasicItem(QListView* view, LogLine* line) {
LogListItem* item=new LogListItem(view, line);
initItem(item);
return(item);
}
void ItemFactory::initItem(LogListItem* item) {
LogLine* line=item->getLogLine();
//If it's a Xorg Log Line
if (line->getType() == Globals::xorgMode->id) {
initXorgItem(item);
return;
}
//Default Item
initDefaultItem(item);
}
void ItemFactory::initDefaultItem(LogListItem* item) {
LogLine* line=item->getLogLine();
item->setText(0, line->getTime().toString(Qt::LocalDate));
int i=1;
QStringList& labels=line->getItemList();
QStringList::iterator it;
for(it=labels.begin(); it!=labels.end(); ++it) {
item->setText(i, *it);
i++;
}
item->setPixmap(0, line->getLogLevel()->pixmap);
}
void ItemFactory::initXorgItem(LogListItem* item) {
LogLine* line=item->getLogLine();
item->setText(0, "");
int i=1;
QStringList& labels=line->getItemList();
QStringList::iterator it;
for(it=labels.begin(); it!=labels.end(); ++it) {
item->setText(i, *it);
i++;
}
item->setPixmap(0, line->getLogLevel()->pixmap);
}
QString ItemFactory::createFormattedText(LogLine* line) {
//Special case if this is a ParentLogLine (Group By feature)
if (line->isParentLogLine())
return(createParentFormattedText(line));
if (line->getType() == Globals::cronMode->id)
return(createCronFormattedText(line));
if (line->getType() == Globals::xorgMode->id)
return(createXorgFormattedText(line));
if (line->getType() == Globals::acpidMode->id)
return(createAcpidFormattedText(line));
if (line->getType() == Globals::cupsMode->id)
return(createCupsFormattedText(line));
if (line->getType() == Globals::cupsAccessMode->id)
return(createCupsAccessFormattedText(line));
if (line->getType() == Globals::apacheMode->id)
return(createApacheFormattedText(line));
if (line->getType() == Globals::apacheAccessMode->id)
return(createApacheAccessFormattedText(line));
if (line->getType() == Globals::sambaMode->id)
return(createSambaFormattedText(line));
//Returns the default formating
return(createDefaultFormattedText(line));
}
QString ItemFactory::createToolTipText(LogLine* line) {
if (line->getType() == Globals::xorgMode->id)
return(createXorgToolTipText(line));
else
return(createDefaultToolTipText(line));
}
QString ItemFactory::createParentFormattedText(LogLine* line) {
QString result;
ParentLogLine* parent=(ParentLogLine*) line;
//All Group By cases are showed here
if (parent->getGroupBy()==GROUP_BY_LOG_LEVEL) {
result.append(i18n("<div align='center'><b>Group:</b> %1</div>").arg(line->getLogLevel()->name));
}
else if (parent->getGroupBy()==GROUP_BY_DAY) {
result.append(i18n("<div align='center'><b>Group:</b> %1</div>").arg(line->getTime().date().toString()));
}
else if (parent->getGroupBy()==GROUP_BY_HOUR) {
QString string(i18n("%1, %2 hour").arg(line->getTime().date().toString(), line->getTime().time().toString("h")));
result.append(i18n("<div align='center'><b>Group:</b> %1</div>").arg(string));
}
else if (parent->getGroupBy()==GROUP_BY_LOG_FILE) {
result.append(i18n("<div align='center'><b>Group:</b> %1</div>").arg(line->getOriginalFile()));
}
else {
QStringList& list=line->getItemList();
int index=ParentLogLine::getGroupedColumnIndex(parent->getColumns(), parent->getGroupByColumn());
if (index<0 || index>=(int) list.size())
result.append(i18n("<div align='center'><b>Group:</b> none</div>"));
else
result.append(i18n("<div align='center'><b>Group:</b> %1</div>").arg(list[index]));
}
return(result);
}
QString ItemFactory::createCronFormattedText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Hostname:"), items[0]));
result.append(labelMessageFormat(i18n("Process:"), items[1]));
result.append(labelMessageFormat(i18n("User:"), items[2]));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Original file:"), line->getOriginalFile()));
result.append("</table>");
return(result);
}
QString ItemFactory::createDefaultFormattedText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Hostname:"), items[0]));
result.append(labelMessageFormat(i18n("Process:"), items[1]));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Original file:"), line->getOriginalFile()));
result.append("</table>");
return(result);
}
QString ItemFactory::createAcpidFormattedText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Type:"), items[0]));
result.append("</table>");
return(result);
}
QString ItemFactory::createCupsFormattedText(LogLine* line) {
QString result;
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append("</table>");
return(result);
}
QString ItemFactory::createCupsAccessFormattedText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Hostname:"), items[0]));
result.append(labelMessageFormat(i18n("Identification:"), items[1]));
result.append(labelMessageFormat(i18n("Username:"), items[2]));
result.append(labelMessageFormat(i18n("HTTP Response:"), items[3]));
result.append(labelMessageFormat(i18n("Bytes Sent:"), items[4]));
result.append("</table>");
return(result);
}
QString ItemFactory::createApacheFormattedText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Client:"), items[0]));
result.append("</table>");
return(result);
}
QString ItemFactory::createApacheAccessFormattedText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Hostname:"), items[0]));
result.append(labelMessageFormat(i18n("Identification:"), items[1]));
result.append(labelMessageFormat(i18n("Username:"), items[2]));
result.append(labelMessageFormat(i18n("HTTP Response:"), items[3]));
result.append(labelMessageFormat(i18n("Bytes Sent:"), items[4]));
result.append(labelMessageFormat(i18n("Agent Identity:"), items[5]));
result.append(labelMessageFormat(i18n("HTTP Request:"), items[6]));
result.append("</table>");
return(result);
}
QString ItemFactory::createSambaFormattedText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Source File:"), items[0]));
result.append(labelMessageFormat(i18n("Function:"), items[1]));
result.append(labelMessageFormat(i18n("Line:"), items[2]));
result.append("</table>");
return(result);
}
QString ItemFactory::createXorgFormattedText(LogLine* line) {
//It uses the same formating than the Tooltip
return(createXorgToolTipText(line));
}
QString ItemFactory::createDefaultToolTipText(LogLine* line) {
QString result;
result.append("<table>");
result.append(labelMessageFormat(i18n("Date:"), line->getTime().toString(Qt::LocalDate)));
result.append(labelMessageFormat(i18n("Level:"), line->getLogLevel()->name));
result.append(labelMessageFormat(i18n("Original file:"), line->getOriginalFile()));
result.append("</table>");
return(result);
}
QString ItemFactory::createXorgToolTipText(LogLine* line) {
QString result;
QStringList& items=line->getItemList();
result.append("<table>");
if (items[0].isEmpty())
result.append(labelMessageFormat(i18n("Type:"), i18n("none")));
else
result.append(labelMessageFormat(i18n("Type:"), items[0]));
result.append(labelMessageFormat(i18n("Original file:"), line->getOriginalFile()));
result.append("</table>");
return(result);
}
QString ItemFactory::labelMessageFormat(QString label, QString value) {
return ("<tr><td align='right'><b><nobr>" + label + "</nobr></b></td><td>" + messageFormat(value) + "</td></tr>");
}
QString ItemFactory::messageFormat(QString& message) {
QString transformation(message);
transformation.replace(QRegExp("&"), "&amp;");
transformation.replace(QRegExp("<"), "&lt;");
transformation.replace(QRegExp(">"), "&gt;");
return(transformation);
}

@ -0,0 +1,87 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _ITEM_FACTORY_H_
#define _ITEM_FACTORY_H_
#include <qobject.h>
#include <qlistview.h>
class LogLine;
class ParentLogLine;
class ChildLogLine;
class LogListItem;
/**
* @author Nicolas Ternisien
*/
class ItemFactory {
public:
static LogListItem* createLogListItem(QListView* view, LogLine* line);
static QString createFormattedText(LogLine* line);
static QString createToolTipText(LogLine* line);
//Global useful methods
static QString messageFormat(QString& message);
static QString labelMessageFormat(QString label, QString value);
private:
static LogListItem* createItem(QListView* view, LogLine* line);
static LogListItem* createParentItem(QListView* view, ParentLogLine* line);
static LogListItem* createChildItem(QListView* view, ChildLogLine* line);
static LogListItem* createBasicItem(QListView* view, LogLine* line);
static void initXorgItem(LogListItem* item);
static void initDefaultItem(LogListItem* item);
static void initItem(LogListItem* item);
static QString createXorgFormattedText(LogLine* line);
static QString createCronFormattedText(LogLine* line);
static QString createAcpidFormattedText(LogLine* line);
static QString createCupsFormattedText(LogLine* line);
static QString createCupsAccessFormattedText(LogLine* line);
static QString createParentFormattedText(LogLine* line);
static QString createDefaultFormattedText(LogLine* line);
static QString createApacheFormattedText(LogLine* line);
static QString createApacheAccessFormattedText(LogLine* line);
static QString createSambaFormattedText(LogLine* line);
static QString createXorgToolTipText(LogLine* line);
static QString createDefaultToolTipText(LogLine* line);
};
#endif

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_kernel.la
libksystemlog_kernel_la_LDFLAGS = $(all_libraries)
libksystemlog_kernel_la_SOURCES = kernelOptions.cpp
noinst_HEADERS = kernelOptions.h

@ -0,0 +1,101 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "kernelOptions.h"
#include "ksystemlogConfig.h"
KernelOptions::KernelOptions(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QString description= i18n("<qt><p>These files will be analyzed to display <b>Kernel logs</b>. This list also determines the order in which the files are read.</p></qt>");
fileList=new SpecificFileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
KernelOptions::~KernelOptions() {
}
bool KernelOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void KernelOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void KernelOptions::saveConfig() {
kdDebug() << "Saving config from Kernel Options..." << endl;
QStringList stringList;
QValueList<int> valueList;
fileList->saveConfig(stringList, valueList);
KSystemLogConfig::setKernelPaths(stringList);
KSystemLogConfig::setKernelLevels(valueList);
}
void KernelOptions::readConfig() {
QStringList stringList=KSystemLogConfig::kernelPaths();
QValueList<int> valueList=KSystemLogConfig::kernelLevels();
fileList->readConfig(stringList, valueList);
}
#include "kernelOptions.moc"

@ -0,0 +1,62 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _KERNEL_OPTIONS_H_
#define _KERNEL_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "specificFileList.h"
#include "logLevel.h"
class KernelOptions : public QWidget {
Q_OBJECT
public:
KernelOptions(QWidget *parent = 0);
~KernelOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
SpecificFileList* fileList;
};
#endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,28 @@
[Desktop Entry]
Encoding=UTF-8
Name=KSystemLog
Name[sv]=Ksystemlogg
Name[tr]=KSistemGünlüğü
Exec=kdesu ksystemlog %i %m -caption "%c"
Icon=ksystemlog
Type=Application
DocPath=ksystemlog/ksystemlog.html
Comment=System log viewer tool
Comment[da]=Værktøj til at vise systemlog
Comment[el]=Εργαλείο προβολής καταγραφής συστήματος
Comment[et]=Süsteemse logi vaatamise tööriist
Comment[fr]=Outil de visualisation des journaux système
Comment[it]=Strumento di visualizzazione registro di sistema (log)
Comment[pa]=ਸਿਸਟਮ ਲਾਗ ਦਰਸ਼ਕ ਸੰਦ
Comment[pt]=Ferramenta de visualização dos registos do sistema
Comment[sv]=Visningsverktyg för systemlogg
Comment[tr]=Sistem günlük görüntüleyicisi aracı
Terminal=0
GenericName=System Logs Viewer
GenericName[da]=System logfremviser
GenericName[et]=Süsteemse logi näitaja
GenericName[it]=Visualizzatore registri di sistema
GenericName[pt]=Visualizador de Registos do Sistema
GenericName[sv]=Systemloggvisning
GenericName[tr]=Sistem Günlükleri Görüntüleyicisi
Categories=Qt;KDE;Application;System;

@ -0,0 +1,294 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef KSYSTEM_LOG_H
#define KSYSTEM_LOG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
//Qt includes
#include <qlistview.h>
#include <qvaluevector.h>
//KDE includes
#include <kapplication.h>
#include <kmainwindow.h>
#include <kconfig.h>
#include <ktabwidget.h>
#include <kactionclasses.h>
#include <kpopupmenu.h>
//For compatibility with old versions of KDE
#include <kdeversion.h>
//Project includes
#include "detailDialog.h"
#include "logLevel.h"
#include "logManager.h"
#include "loadingDialog.h"
#include "findManager.h"
#include "globals.h"
//Include the right header for the management of Log Action clicking, depending of the version of KDE
#if defined(KDE_MAKE_VERSION) && (KDE_VERSION >= KDE_MAKE_VERSION(3,4,0))
#include "slotLogAction.h"
#else
#include "slotLogActionCompatibility.h"
#endif
#define STATUS_BAR_LINE_COUNT 1
#define STATUS_BAR_LAST_MODIFICATION 2
class LogFile;
typedef QValueList<LogFile*> LogFiles;
class KPrinter;
class KToggleAction;
class KURL;
/**
* This class serves as the main window for ksystemlog. It handles the
* menus, toolbars, and status bars.
*
* @short Main window class
* @author Nicolas Ternisien <nicolas.ternisien@gmail.com>
* @version 0.1
*/
class KSystemLog : public KMainWindow {
Q_OBJECT
public:
/**
* Default Constructor
*/
KSystemLog();
/**
* Default Destructor
*/
virtual ~KSystemLog();
groupByType getGroupBy(int& column);
int getIndex(LogManager* manager);
/**
* Specialized methods about LogManagers
* TODO Maybe move them to a dedicated LogManagers class
* (which can subclass QValueList<LogManager*>)
*/
LogManager* activeLogManager();
void setCurrentLogManager(LogManager* view);
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
//Actual KDE method
void logActionClicked(const QObject* sender, KAction::ActivationReason reason, Qt::ButtonState state);
#else
//Method for old versions of KDE
void logActionClicked(const QObject* sender);
#endif
void load(LogMode* logMode, LogManager* manager);
protected:
/**
* Overridden virtuals for Qt drag'n drop (XDND)
*/
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
protected:
/**
* This function is called when it is time for the app to save its
* properties for session management purposes.
*/
void saveProperties(KConfig *);
/**
* This function is called when this app is restored. The KConfig
* object points to the session management config file that was saved
* with @ref saveProperties
*/
void readProperties(KConfig *);
void setupLogLevels();
private slots:
void fileOpen();
void filePrint();
void slotOptions();
public slots:
void changeStatusbar(const QString& text);
void changeCaption(const QString& text);
void changeTab(View* view, const QString& label);
void changeTab(View* view, const QIconSet& icon, const QString& label);
void updateStatusBar();
void updateGUI();
void logUpdated(int lines);
void slotSelectAll();
void slotToggleFilterBar();
void slotLogMessage();
void reloadCurrent();
void reloadAll();
LogManager* newTab();
LogManager* duplicateTab();
void closeTab();
void moveTabLeft();
void moveTabRight();
void logManagerReloaded();
void currentTabChanged(QWidget* view);
void slotTooltipEnabled(bool enabled);
void slotNewLinesDisplayed(bool displayed);
void slotSelectionChanged(); //replace void logListSelectionChanged();
void slotDetails();
void groupByChanged(int group);
void pauseParsing();
void resumeParsing();
void quit();
private:
//Object managing the signals come from the selection of a Log Mode
SlotLogAction* slotLogAction;
/**
* Get the Log Action called name from actionCollection()
*/
KToggleAction* getLogAction(const char* name);
KToggleAction* getCorrespondingLogAction(LogMode* mode);
void setupStatusBar();
void setupTabBar();
void setupProgressDialog();
void setupGroupBy();
void setupActions();
void setupLogActions();
void readConfig();
void saveConfig();
void deactiveLogActions();
void updateGroupBy();
LogManagers logManagers;
KPrinter* printer;
KAction* newTabAction;
KAction* closeTabAction;
KAction* duplicateTabAction;
KAction* moveTabLeftAction;
KAction* moveTabRightAction;
KAction* saveAction;
KAction* copyAction;
KAction* sendMailAction;
KAction* logMessageAction;
KToggleAction* filterBarAction;
KAction* reloadAction;
KAction* expandAllAction;
KAction* collapseAllAction;
KAction* resumeParsingAction;
KAction* pauseParsingAction;
KAction* detailAction;
KToggleAction* tooltipEnabledAction;
KToggleAction* newLinesDisplayedAction;
/**
* The Group By Action Menu
*/
KActionMenu* groupBy;
/**
* A pointer to the Detail dialog
*/
DetailDialog* detailDialog;
/**
* Loading Dialog
*/
LoadingDialog* loadingDialog;
/**
* Find Manager
*/
FindManager* findManager;
/**
* The tab widget managing different views
*/
KTabWidget* tabs;
QMap<KToggleAction*, LogMode*> mapActionLogModes;
};
#endif //KSYSTEM_LOG_H

@ -0,0 +1,16 @@
Begin3
Title: KSystemLog -- System Log Viewer Tool
Version: 0.1.1
Entered-date:
Description: System Log Viewer Tool for KDE
Keywords: KDE Qt System Log
Author: Nicolas Ternisien <nicolas.ternisien@gmail.com>
Maintained-by: Nicolas Ternisien <nicolas.ternisien@gmail.com>
Home-page: http://www.kde-apps.org/content/show.php?content=23761
Alternate-site:
Primary-site: http://annivernet.free.fr/images/divers/ksystemlog/
0.1.1 ksystemlog-0.1.1.tar.gz
0.1.1 ksystemlog-0.1.1.lsm
Platform: Linux. Needs KDE
Copying-policy: GPL
End

@ -0,0 +1,37 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _KSYSTEMLOGIFACE_H_
#define _KSYSTEMLOGIFACE_H_
#include <dcopobject.h>
class KSystemLogInterface : virtual public DCOPObject {
K_DCOP
public:
k_dcop:
virtual void openURL(QString url) = 0;
};
#endif // _KSYSTEMLOGIFACE_H_

@ -0,0 +1,96 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="ksystemlog" version="1">
<MenuBar>
<Menu name="file">
<text>&amp;File</text>
<Action name="send_mail" />
<Action name="log_message" />
</Menu>
<Menu name="edit">
<text>&amp;Edit</text>
<Action name="reload" />
<Separator/>
<Action name="select_all" />
<Action name="expand_all" />
<Action name="collapse_all" />
<Separator/>
<Action name="copy" />
<Separator/>
<Action name="find" />
<Action name="find_next" />
<Separator/>
<Action name="group_by" />
<Action name="details" />
</Menu>
<Menu name="logs">
<text>&amp;Logs</text>
<Action name="system_log" />
<Action name="xorg_log" />
<Action name="kernel_log" />
<Separator/>
<Action name="boot_log" />
<Action name="authentication_log" />
<Action name="daemon_log" />
<Action name="cron_log" />
<Action name="acpid_log" />
<Menu name="cups" icon="fileprint">
<text>&amp;CUPS</text>
<Action name="cups_log" />
<Action name="cups_access_log" />
</Menu>
<Separator/>
<Menu name="apache" icon="network">
<text>&amp;Apache</text>
<Action name="apache_log" />
<Action name="apache_access_log" />
</Menu>
<Action name="postfix_log" />
<Action name="samba_log" />
</Menu>
<Menu name="settings">
<text>&amp;Settings</text>
<Action name="toggle_filter_bar" />
</Menu>
<Menu name="window">
<text>&amp;Window</text>
<Action name="new_tab" />
<Action name="duplicate_tab" />
<Action name="close_tab" />
<Separator/>
<Action name="move_tab_left" />
<Action name="move_tab_right" />
</Menu>
</MenuBar>
<ToolBar name="logToolBar" noMerge="1" >
<text>Main Logs Toolbar</text>
<Action name="system_log" />
<Action name="xorg_log" />
<Action name="kernel_log" />
<Separator/>
<Action name="boot_log" />
<Action name="authentication_log" />
<Action name="cups_log" />
</ToolBar>
<ToolBar name="mainToolBar" noMerge="1" >
<text>Main Toolbar</text>
<Action name="resume_parsing" />
<Action name="pause_parsing" />
<Action name="reload" />
<Action name="abort" />
<Separator/>
<Action name="details" />
<Separator/>
<Action name="group_by" />
</ToolBar>
</kpartgui>

@ -0,0 +1,145 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include "loadingDialog.h"
LoadingDialog::LoadingDialog(QWidget* parent, const char* name, bool modal) :
KProgressDialog(parent, name, i18n("Loading Progress"), "", modal),
tabCount(0),
currentTab(0),
fileCount(0),
currentFile(0),
firstLoading(false)
{
//TODO Try to find a better solution (if it exists!)
resize(380, 110);
}
LoadingDialog::~LoadingDialog() {
}
bool LoadingDialog::isFirstLoading() {
return(firstLoading);
}
void LoadingDialog::setFirstLoading(bool first) {
firstLoading=first;
}
int LoadingDialog::getTabCount() {
return(tabCount);
}
void LoadingDialog::setTabCount(int count) {
this->tabCount=count;
if (tabCount==0)
hide();
else
show();
}
int LoadingDialog::getFileCount() {
return(fileCount);
}
void LoadingDialog::setFileCount(int count) {
this->fileCount=count;
}
int LoadingDialog::getCurrentFile() {
return(currentFile);
}
void LoadingDialog::setCurrentFile(int current) {
this->currentFile=current;
}
int LoadingDialog::getCurrentTab() {
return(currentTab);
}
void LoadingDialog::setCurrentTab(int current) {
this->currentTab=current;
}
void LoadingDialog::hide() {
//Only hide the Loading Dialog if there is only one Log Manager to load
if (tabCount<=1) {
KProgressDialog::hide();
}
}
void LoadingDialog::setLoadingLog(const QString& text) {
//Several files to load
if (fileCount>1 && currentFile>=1) {
//Several tabs to load
if (tabCount>1 && currentTab>=1) {
if (firstLoading)
setLabel(i18n("<qt>Loading <b>%1</b> [<b>%2</b>/%3 file] (<b>%4</b>/%5)...</qt>").arg(text).arg(currentFile).arg(fileCount).arg(currentTab).arg(tabCount));
else
setLabel(i18n("<qt>Reloading <b>%1</b> [<b>%2</b>/%3 file] (<b>%4</b>/%5)...</qt>").arg(text).arg(currentFile).arg(fileCount).arg(currentTab).arg(tabCount));
}
//Only one tab to load
else {
if (firstLoading)
setLabel(i18n("<qt>Loading <b>%1</b> [<b>%2</b>/%3 file]...</qt>").arg(text).arg(currentFile).arg(fileCount));
else
setLabel(i18n("<qt>Reloading <b>%1</b> [<b>%2</b>/%3 file]...</qt>").arg(text).arg(currentFile).arg(fileCount));
}
}
//Only one file
else {
//Several tabs to load
if (tabCount>1 && currentTab>=1) {
if (firstLoading)
setLabel(i18n("<qt>Loading <b>%1</b> (<b>%2</b>/%3)...</qt>").arg(text).arg(currentTab).arg(tabCount));
else
setLabel(i18n("<qt>Reloading <b>%1</b> (<b>%2</b>/%3)...</qt>").arg(text).arg(currentTab).arg(tabCount));
}
//Only one tab to load
else {
if (firstLoading)
setLabel(i18n("<qt>Loading <b>%1</b>...</qt>").arg(text));
else
setLabel(i18n("<qt>Reloading <b>%1</b>...</qt>").arg(text));
}
}
}
#include "loadingDialog.moc"

@ -0,0 +1,88 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _LOADING_DIALOG_H_
#define _LOADING_DIALOG_H_
#include <qwidget.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <kprogress.h>
#include <kiconloader.h>
#include "view.h"
#include "logListItem.h"
/**
* To use this class, simply call set the Loading Log, and update with setProcess
* To manage group of Logs, use setCount() and setCurrent() methods
*
* TODO Make the processEvents() method here (move from KSystemLog class
* (and also remove signal/slot dedicated for this operation))
*
* TODO Try to have the Cancel button functional (for the moment, it only hide the Loading Dialog)
*/
class LoadingDialog : public KProgressDialog {
Q_OBJECT
public:
LoadingDialog(QWidget* parent=0, const char* name=0, bool modal=false);
~LoadingDialog();
void setLoadingLog(const QString& text);
//Methods managing the position in the tab loading
int getTabCount();
void setTabCount(int count);
int getCurrentTab();
void setCurrentTab(int current);
//Methods managing the position in the files loading of each log
int getFileCount();
void setFileCount(int count);
int getCurrentFile();
void setCurrentFile(int current);
virtual void hide();
bool isFirstLoading();
void setFirstLoading(bool first);
private:
//Attributes managing the position in the tab loading
int tabCount;
int currentTab;
//Attributes managing the position in the files loading of each log
int fileCount;
int currentFile;
bool firstLoading;
};
#endif // _LOADING_DIALOG_H_

@ -0,0 +1,32 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "logFile.h"
LogFile::LogFile(KURL& u, LogLevel* lvl) :
url(u),
lastFileSize(0),
level(lvl) {
}
LogFile::~LogFile() {
}

@ -0,0 +1,71 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _LOG_FILE_H_
#define _LOG_FILE_H_
#include <qobject.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qdatetime.h>
#include <qlistview.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <kurl.h>
#include "globals.h"
#include "logLevel.h"
//class KSystemLog;
class LogFile;
typedef QValueList<LogFile*> LogFiles;
/**
* @author Nicolas Ternisien
*/
class LogFile {
public:
LogFile(KURL& url, LogLevel* level);
//If a day we are able to avoid cross reference between KSystemLog and LogFile class
//Then this constructor (with a default level value) would be better than the previous
//one.
/*LogFile(KURL& url, LogLevel* level=KSystemLog::informationLogLevel);*/
virtual ~LogFile();
KURL url;
long lastFileSize;
LogLevel* level;
};
//#include "ksystemlog.h"
#endif // _LOG_FILE_H_

@ -0,0 +1,54 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <kiconloader.h>
#include "logLevel.h"
LogLevel::LogLevel(int id, QString& nm, QString& ic, QColor& col) :
id(id),
name(nm),
icon(ic),
color(col),
pixmap(SmallIcon(ic)) {
}
LogLevel::LogLevel(int id, QString name, const char* ic, QColor col) :
id(id),
name(name),
icon(ic),
color(col),
pixmap(SmallIcon(ic)) {
}
LogLevel::~LogLevel() {
}
/*
QString& LogLevel::getName() {
return(name);
}
*/

@ -0,0 +1,67 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _LOG_LEVEL_H_
#define _LOG_LEVEL_H_
#include <qobject.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <qptrlist.h>
#include <qcolor.h>
#include <kurl.h>
#include "globals.h"
class LogLevel;
typedef QPtrList<LogLevel> LogLevels;
/**
* @author Nicolas Ternisien
*/
class LogLevel {
public:
LogLevel(int id, QString& name, QString& icon, QColor& color);
LogLevel(int id, QString name, const char* icon, QColor color);
virtual ~LogLevel();
int id;
QString name;
QString icon;
QColor color;
QPixmap pixmap;
};
#endif

@ -0,0 +1,175 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//KDE includes
#include <kdebug.h>
//Project includes
#include "itemFactory.h"
#include "logLine.h"
LogLine::LogLine(QDate& date, QTime& time, QStringList& list, QString& file, LogLevel* level, int type) :
time(date, time),
itemList(list),
originalFile(file),
logLevel(level),
type(type),
recent(false),
item(NULL) {
}
LogLine::~LogLine() {
if (item!=NULL)
delete item;
}
int LogLine::getType() {
return(type);
}
void LogLine::setType(int t) {
type=t;
}
bool LogLine::itemExists() {
if (item==NULL)
return(false);
else
return(true);
}
void LogLine::setRecent(bool recent) {
this->recent=recent;
if (item!=NULL) {
//TODO This is certainly the main problem of the unknown crash bug !
//item->repaint();
}
}
bool LogLine::isRecent() {
return(recent);
}
LogListItem* LogLine::getLogListItem() {
return(item);
}
LogListItem* LogLine::insertItem(QListView* view) {
if (item==NULL) {
item=ItemFactory::createLogListItem(view, this);
}
return(item);
}
bool LogLine::equals(LogLine& other) {
if (getType() != other.getType())
return(false);
if (getTime() != other.getTime())
return(false);
if (getLogLevel() != other.getLogLevel())
return(false);
/*
if (getOriginalFile() != other.getOriginalFile())
return(false);
*/
if (getItemList() != other.getItemList())
return(false);
return(true);
}
void LogLine::removeItem(QListView* view) {
if (item==NULL)
return;
view->takeItem(item);
}
LogLevel* LogLine::getLogLevel() {
return(logLevel);
}
void LogLine::setLogLevel(LogLevel* level) {
logLevel=level;
}
QDateTime& LogLine::getTime() {
return(time);
}
QStringList& LogLine::getItemList() {
return(itemList);
}
QString& LogLine::getOriginalFile() {
return(originalFile);
}
bool LogLine::isOlderThan(LogLine& other) {
return(time<=other.getTime());
}
bool LogLine::isNewerThan(LogLine& other) {
return(time>=other.getTime());
}
bool LogLine::isOlderThan(QDateTime& other) {
return(time<=other);
}
bool LogLine::isNewerThan(QDateTime& other) {
return(time>=other);
}
bool LogLine::isSameTime(LogLine& other) {
return(time==other.getTime());
}
bool LogLine::operator<(LogLine& other) {
return(isOlderThan(other));
}
bool LogLine::operator>(LogLine& other) {
return(isNewerThan(other));
}
void LogLine::ensureItemVisible(QListView* view) {
if (item!=NULL)
view->ensureItemVisible(item);
}
bool LogLine::isParentLogLine() {
return(false);
}
bool LogLine::isChildLogLine() {
return(false);
}

@ -0,0 +1,111 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _LOG_LINE_H_
#define _LOG_LINE_H_
#include <qobject.h>
#include <qstringlist.h>
#include <qdatetime.h>
#include <qlistview.h>
#include <kurl.h>
#include "globals.h"
#include "logListItem.h"
#include "logLevel.h"
class LogListItem;
class ParentLogLine;
class ChildLogLine;
/**
* @author Nicolas Ternisien
*/
class LogLine {
public:
LogLine(QDate& date, QTime& time, QStringList& list, QString& originalFile, LogLevel* level, int tpe);
virtual ~LogLine();
bool isOlderThan(LogLine& other);
bool isNewerThan(LogLine& other);
bool isOlderThan(QDateTime& other);
bool isNewerThan(QDateTime& other);
bool equals(LogLine& other);
bool isSameTime(LogLine& other);
bool operator<(LogLine& other);
bool operator>(LogLine& other);
//bool operator==(LogLine& other);
LogLevel* getLogLevel();
void setLogLevel(LogLevel* level);
QDateTime& getTime();
QStringList& getItemList();
QString& getOriginalFile();
int getType();
void setType(int t);
void setRecent(bool recent);
bool isRecent();
bool itemExists();
//Use this function carefully (don't delete the returned object for example)
LogListItem* getLogListItem();
virtual LogListItem* insertItem(QListView* view);
void removeItem(QListView* view);
void ensureItemVisible(QListView* view);
virtual bool isParentLogLine();
virtual bool isChildLogLine();
protected:
QDateTime time;
QStringList itemList;
QString originalFile;
LogLevel* logLevel;
int type;
bool recent;
LogListItem* item;
};
#endif

@ -0,0 +1,80 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//For compatibility with old versions of KDE
#include <kdeversion.h>
//The filter is activated only if KDE version >= 3.3
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
#include <qpainter.h>
#include <klocale.h>
#include "logLineFilter.h"
LogLineFilter::LogLineFilter(QWidget* parent, KListView* listView, const char* name) :
KListViewSearchLine(parent, listView, name) {
drawFilterMessage = true;
repaint();
}
void LogLineFilter::drawContents(QPainter *p) {
KListViewSearchLine::drawContents( p );
if ( drawFilterMessage == true && !hasFocus() ) {
QPen tmp = p->pen();
p->setPen( palette().color( QPalette::Disabled, QColorGroup::Text ) );
QRect cr = contentsRect();
//p->drawPixmap( 3, 3, SmallIcon("filter") );
// Add two pixel margin on the left side
cr.rLeft() += 3;
p->drawText( cr, AlignAuto | AlignVCenter, i18n("Filter here...") );
p->setPen( tmp );
}
}
void LogLineFilter::focusInEvent( QFocusEvent *ev )
{
if ( drawFilterMessage == true ) {
drawFilterMessage = false;
repaint();
}
KListViewSearchLine::focusInEvent( ev );
}
void LogLineFilter::focusOutEvent( QFocusEvent *ev )
{
if ( text().isEmpty() ) {
drawFilterMessage = true;
repaint();
}
KListViewSearchLine::focusOutEvent( ev );
}
#endif

@ -0,0 +1,58 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef LOG_LINE_FILTER_H
#define LOG_LINE_FILTER_H
//For compatibility with old versions of KDE
#include <kdeversion.h>
//The filter is activated only if KDE version >= 3.3
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
#include <klistviewsearchline.h>
/**
This class provides a KLineEdit which contains a greyed-out hinting
text as long as the user didn't enter any text
Code taken from Daniel Molkentin (Amarok project)
@short LineEdit with customizable "Click here" text
@author Nicolas Ternisien
*/
class LogLineFilter : public KListViewSearchLine
{
public:
LogLineFilter(QWidget* parent=NULL, KListView* listView=NULL, const char* name=NULL);
protected:
virtual void drawContents( QPainter *p );
virtual void focusInEvent( QFocusEvent *ev );
virtual void focusOutEvent( QFocusEvent *ev );
private:
bool drawFilterMessage;
};
#endif
#endif //LOG_LINE_FILTER_H

@ -0,0 +1,271 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "logLineList.h"
#include "logLine.h"
#include "view.h"
LogLineList::LogLineList() :
oldestLogLine(NULL),
firstAdd(true)
{
}
LogLineList::~LogLineList() {
}
LogLine* LogLineList::getOldestLine() {
return(oldestLogLine);
}
void LogLineList::removeOldestLine() {
LogLine* line=this->getOldestLine();
if (line!=NULL) {
this->remove(line);
}
}
bool LogLineList::isNewer(LogLine* line) {
LogLine* olderLine=this->getOldestLine();
if (olderLine==NULL)
return(true);
return(line->isNewerThan(*olderLine));
}
bool LogLineList::isEmpty() {
return(list.isEmpty());
}
LogLine* LogLineList::lastLineInserted() {
//Can also returns NULL
return(list.last());
}
int LogLineList::getNewLineCount() {
return(addedList.count());
}
void LogLineList::insert(LogLine* line) {
if (!isNewer(line) || list.count()==0) {
oldestLogLine=line;
}
addedList.append(line);
list.append(line);
}
bool LogLineList::lineAlreadyExists(LogLine* line) {
QPtrListIterator<LogLine> it(list);
LogLine* other=it.current();
while (other!=NULL) {
if (other->equals(*line))
return(true);
++it;
other=it.current();
}
return(false);
}
bool LogLineList::remove(LogLine* removedLine) {
QPtrListIterator<LogLine> it(list);
LogLine* line=it.current();
while (line!=NULL) {
if (this->equals(removedLine, line)) {
removedList.append(line);
addedList.remove(line);
list.remove(line);
//Now find the new oldest line
updateOldestLine();
return(true);
}
++it;
line=it.current();
}
return(false);
}
bool LogLineList::equals(LogLine* l1, LogLine* l2) {
return(l1->equals(*l2));
}
int LogLineList::getItemCount() {
return(list.count());
}
void LogLineList::clear() {
QPtrListIterator<LogLine> it(list);
LogLine* line=it.current();
while (line!=NULL) {
removedList.append(line);
++it;
line=it.current();
}
list.clear();
oldestLogLine=NULL;
}
LogLine* LogLineList::synchronize(View* view) {
synchronizeRemovedLines(view);
if (firstAdd==false && !addedList.isEmpty()) {
synchronizeRecentLines();
}
LogLine* line=NULL;
line=synchronizeAddedLines(view);
kdDebug() << "Returning the added line..." << endl;
return(line);
}
void LogLineList::synchronizeRemovedLines(View* view) {
QPtrListIterator<LogLine> it(removedList);
LogLine* line=it.current();
kdDebug() << "Removing old items from list..." << endl;
//We removed the old items
while(line!=NULL) {
if (line->itemExists())
line->removeItem(view->getLogList());
//TODO Delete the line object
++it;
line=it.current();
}
removedList.clear();
}
LogLine* LogLineList::synchronizeAddedLines(View* view) {
kdDebug() << "Adding new items to the list..." << endl;
//We add the new items
QPtrListIterator<LogLine> it(addedList);
LogLine* line=it.current();
while (line!=NULL) {
line->insertItem(view->getLogList());
++it;
line=it.current();
}
kdDebug() << "Returning latest item..." << endl;
//Get the last line of addedList list (can be NULL)
line=addedList.last();
addedList.clear();
//Returns line, even if line is NULL (must be tested by the caller class)
return(line);
}
void LogLineList::synchronizeRecentLines() {
kdDebug() << "Recent items become normal..." << endl;
//The older lines are no longer recent
QPtrListIterator<LogLine> it(recentList);
LogLine* line=it.current();
while (line!=NULL) {
//kdDebug() << "before setRecent... " << endl;
//kdDebug() << "before setRecent original... : " << line->getOriginalFile() << endl;
line->setRecent(false);
//kdDebug() << "after setRecent..." << endl;
++it;
line=it.current();
}
recentList.clear();
kdDebug() << "New items become recent..." << endl;
//The new lines added becomes recent
it=addedList;
line=it.current();
while (line!=NULL) {
line->setRecent(true);
recentList.append(line);
++it;
line=it.current();
}
}
void LogLineList::setFirstReadPerformed(bool add) {
firstAdd=!add;
}
void LogLineList::updateOldestLine() {
QPtrListIterator<LogLine> it(list);
if (it.current()==NULL)
oldestLogLine=NULL;
oldestLogLine=it.current();
LogLine* line=it.current();
while (line!=NULL) {
if (line->isOlderThan(*oldestLogLine))
oldestLogLine=line;
++it;
line=it.current();
}
}

@ -0,0 +1,113 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _LOG_LINE_LIST_H_
#define _LOG_LINE_LIST_H_
#include <qobject.h>
#include <qptrlist.h>
#include <qmap.h>
#include <kdebug.h>
#include "globals.h"
#include "qlistview.h"
#include "logLine.h"
class View;
/**
* @author Nicolas Ternisien
*/
class LogLineList {
public:
LogLineList();
virtual ~LogLineList();
/**
* Synchronize the view with this buffer and returns the last added item
*/
virtual LogLine* synchronize(View* view);
LogLine* getOldestLine();
int getItemCount();
void clear();
bool isEmpty();
void removeOldestLine();
virtual bool remove(LogLine* line);
virtual void insert(LogLine* line);
//Can also returns NULL
LogLine* lastLineInserted();
bool equals(LogLine* l1, LogLine* l2);
bool lineAlreadyExists(LogLine* line);
bool isNewer(LogLine* line);
int getNewLineCount();
void setFirstReadPerformed(bool add);
protected:
/**
* Synchronize the old recent lines, then the new ones
*/
virtual void synchronizeRecentLines();
/**
* Synchronize the lines to delete
*/
virtual void synchronizeRemovedLines(View* view);
/**
* Synchronize new lines and returns the last one
*/
virtual LogLine* synchronizeAddedLines(View* view);
void updateOldestLine();
QPtrList<LogLine> list;
QPtrList<LogLine> addedList;
QPtrList<LogLine> removedList;
QPtrList<LogLine> recentList;
LogLine* oldestLogLine;
bool firstAdd;
};
#endif

@ -0,0 +1,213 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "logLineTree.h"
#include "parentLogLine.h"
#include "childLogLine.h"
#include "logLine.h"
#include "view.h"
LogLineTree::LogLineTree(LogViewColumns* cols, groupByType type, int column) :
LogLineList()
{
columns=cols;
groupBy=type;
groupByColumn=column;
}
LogLineTree::~LogLineTree() {
}
void LogLineTree::synchronizeRemovedLines(View* view) {
QPtrListIterator<LogLine> it(removedList);
LogLine* line=it.current();
kdDebug() << "Removing old items from tree..." << endl;
//We removed the old items
while(line!=NULL) {
if (line->itemExists()) {
line->removeItem(view->getLogList());
}
//TODO Delete the line object
++it;
line=it.current();
}
removedList.clear();
}
LogLine* LogLineTree::synchronizeAddedLines(View* view) {
/**
* This old code had to do the same thing than the above code, but
* it was buggy for a strange reason.
* This code wasn't able to find Parent Log Lines in the addedList object
*/
/*
//We first add the new parent items
QPtrListIterator<LogLine> it(addedList);
LogLine* line=it.current();
kdDebug() << "Inserting " << parents.count() << " parent log item" << endl;
int i=0;
while (line!=NULL) {
if (line->isParentLogLine()==true) {
ParentLogLine* parent=(ParentLogLine*) (line);
parent->insertItem(view->getLogList());
addedList.remove(it.current());
++i;
}
++it;
line=it.current();
}
kdDebug() << "Insertion of " << i << " parent log items" << endl;
*/
kdDebug() << "Adding parent items to the tree..." << endl;
//We first add the new parent items
QPtrListIterator<ParentLogLine> it(parents);
LogLine* line=it.current();
while (line!=NULL) {
//Even if the parent has already been added, it will automatically be added once time
line->insertItem(view->getLogList());
addedList.remove(it.current());
++it;
line=it.current();
}
//Returns line, even if line is NULL (must be tested by the caller class)
return(LogLineList::synchronizeAddedLines(view));
}
bool LogLineTree::remove(LogLine* line) {
/**
* Parent log line actions :
* - Only remove this line is it does not have any children left
*/
if (line->isParentLogLine()==true) {
ParentLogLine* parent=(ParentLogLine*) line;
if (parent->hasChildren()==false) {
parents.remove(parent);
return(LogLineList::remove(line));
}
}
/**
* Child log line actions :
* - First remove the dependency from the parent
* - Remove parent if it does not have child left
* - Finally remove child
*/
else if (line->isChildLogLine()==true) {
ChildLogLine* child=(ChildLogLine*) line;
ParentLogLine* parent=child->getParent();
parent->removeChild(child);
//Remove parent if it does not have longer children
if (parent->hasChildren()==false) {
parents.remove(parent);
LogLineList::remove(parent);
}
//Remove the children
return(LogLineList::remove(line));
}
//Default case, with normal log lines
return(LogLineList::remove(line));
}
void LogLineTree::insert(LogLine* line) {
QPtrListIterator<ParentLogLine> it(parents);
ParentLogLine* parent=it.current();
bool insertion=false;
while (parent!=NULL) {
insertion=parent->isChild(line);
if (insertion==true) {
QDate date=line->getTime().date();
QTime time=line->getTime().time();
ChildLogLine* newChild=new ChildLogLine(date, time, line->getItemList(), line->getOriginalFile(), line->getLogLevel(), line->getType());
parent->addChild(newChild);
newChild->setParent(parent);
//Insert this child by the classical way
LogLineList::insert(newChild);
delete line;
return;
}
++it;
parent=it.current();
}
QDate date=line->getTime().date();
QTime time=line->getTime().time();
ParentLogLine* newParent=new ParentLogLine(date, time, line->getItemList(), line->getOriginalFile(), line->getLogLevel(), line->getType(), this->groupBy, this->groupByColumn, this->columns);
//Insert this parent by the classical way
LogLineList::insert(newParent);
parents.append(newParent);
ChildLogLine* newChild=new ChildLogLine(date, time, line->getItemList(), line->getOriginalFile(), line->getLogLevel(), line->getType());
newParent->addChild(newChild);
newChild->setParent(newParent);
//Insert this child by the classical way
LogLineList::insert(newChild);
delete line;
}

@ -0,0 +1,71 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _LOG_LINE_TREE_H_
#define _LOG_LINE_TREE_H_
#include <qobject.h>
#include <qptrlist.h>
#include <qmap.h>
#include <kdebug.h>
#include "logLineList.h"
#include "logViewColumn.h"
#include "parentLogLine.h"
//Try to find a impossible type
#define PARENT_LOG_LINE_TYPE 7777
/**
* @author Nicolas Ternisien
*/
class LogLineTree : public LogLineList {
public:
LogLineTree(LogViewColumns* cols, groupByType type, int column=-1);
virtual ~LogLineTree();
virtual bool remove(LogLine* line);
virtual void insert(LogLine* line);
protected:
QPtrList<ParentLogLine> parents;
groupByType groupBy;
int groupByColumn;
LogViewColumns* columns;
/**
* Synchronize the lines to delete
*/
virtual void synchronizeRemovedLines(View* view);
/**
* Synchronize new lines and returns the last one
*/
virtual LogLine* synchronizeAddedLines(View* view);
};
#endif

@ -0,0 +1,387 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qstringlist.h>
#include <qdatetime.h>
#include <qobject.h>
#include <qpainter.h>
#include <qpen.h>
#include <qclipboard.h>
#include <qcolor.h>
//KDE includes
#include <klocale.h>
#include <kmessagebox.h>
#include <kdebug.h>
//For compatibility with old versions of KDE
#include <kdeversion.h>
//Project includes
#include "itemFactory.h"
#include "parentLogLine.h"
#include "logMode.h"
#include "ksystemlogConfig.h"
#include "logListItem.h"
LogListItem::LogListItem(QListView* list, LogLine* l) :
KListViewItem(list),
line(l)
{
}
LogListItem::LogListItem(QListViewItem* parent, LogLine* l) :
KListViewItem(parent),
line(l)
{
}
LogListItem::~LogListItem() {
}
QString LogListItem::getFormattedText() {
return(ItemFactory::createFormattedText(line));
}
QString LogListItem::getToolTipText() {
return(ItemFactory::createToolTipText(line));
}
LogLine* LogListItem::getLogLine() {
return(line);
}
int LogListItem::compare(QListViewItem* it, int col, bool ascending) const {
if (col==0) {
LogListItem* item=dynamic_cast<LogListItem*> (it);
if (item!=NULL) {
if (line->getTime() < item->getTime())
return(-1);
else if (line->getTime() == item->getTime())
return(0);
else
return(1);
}
return(1);
}
else {
return(QListViewItem::compare(it, col, ascending));
}
}
QDateTime& LogListItem::getTime() {
return(line->getTime());
}
QString LogListItem::exportToText() {
int columnCount=listView()->columns();
QString exporting;
if (columnCount==0)
return(exporting);
int i=0;
while(i<columnCount) {
if (i>0) {
exporting.append('\t');
}
exporting.append(this->text(i));
i++;
}
return(exporting);
}
/**
* Method inspired from a paintCell method of Amarok.
* Many thanks for the team (and the GPL, of course!)
* TODO Retest this method
*/
void LogListItem::paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align) {
/* For debugging
KListViewItem::paintCell( p, cg, column, width, align );
return;
*/
//Get the KListView item
KListView* lv = (KListView *) listView();
if (lv==NULL) {
kdDebug() << "LogListItem::paintCell() : KListView null" << endl;
KListViewItem::paintCell( p, cg, column, width, align );
return;
}
//flicker-free drawing
static QPixmap buffer;
buffer.resize(width, height());
//If there is a problem, let KListViewItem class draw this item
if( buffer.isNull() ) {
kdDebug() << "LogListItem::paintCell() : QPixmap null" << endl;
KListViewItem::paintCell(p, cg, column, width, align);
return;
}
//kdDebug() << "LogListItem::paintCell() : Painting the cell" << endl;
//Initialize our drawing object
QPainter pBuf( &buffer, true );
//Use or not an alternate background
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
if (line->isParentLogLine()==true && column==0)
pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : cg.highlight() );
else
pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : backgroundColor(column) );
#else
pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : backgroundColor() );
#endif
//Change the pen color
pBuf.setPen(cg.button());
//Draw a line at the right
pBuf.drawLine(width-1, 0, width-1, height());
//Gets the current font and font metric
QFont font(p->font());
QFontMetrics fm(p->fontMetrics());
if (line->isParentLogLine()==true && column==0) {
//Draw 3 gray lines around the parent item
pBuf.setPen(cg.button());
pBuf.drawLine(0, 0, width, 0);
pBuf.drawLine(0, height()-1, width, height()-1);
//if (column==0) {
pBuf.drawLine(width-1, 0, width-1, height()-1);
pBuf.drawLine(0, 0, 0, height()-1);
//}
}
//Draw the item name in bold if it is a recent one
if (line->isRecent()==true && column==lv->columns()-1)
font.setBold(true);
//Draw in italic and bold if it's a parent item
else if (line->isParentLogLine()==true && column==0) {
font.setItalic(true);
font.setBold(true);
}
//Normal drawing
else
font.setBold(false);
pBuf.setFont(font);
QFontMetrics fmName(font);
//Draw the pixmap m_loadingPix
if (pixmap(column)) {
pBuf.drawPixmap( (lv->treeStepSize() - pixmap(column)->width())/2,
(height() - pixmap(column)->height())/2,
*pixmap(column) );
}
int text_x;
if (column==0)
text_x=lv->treeStepSize() + 3;
else
text_x=1;
//If this is the first column and also a parent log line
if (line->isParentLogLine()==true && column==0) {
if (KSystemLogConfig::colorizeLogLines() && ((ParentLogLine*)line)->getGroupBy()==GROUP_BY_LOG_LEVEL)
pBuf.setPen( isSelected() ? cg.text() : line->getLogLevel()->color);
else
pBuf.setPen( isSelected() ? cg.text() : cg.highlightedText());
}
//If this is the last column and the colorizeLogLines options is enabled
else if (KSystemLogConfig::colorizeLogLines() && column==lv->columns()-1) {
pBuf.setPen( isSelected() ? cg.highlightedText() : line->getLogLevel()->color );
}
//Normal line
else {
pBuf.setPen( isSelected() ? cg.highlightedText() : cg.text() );
}
QString name = text(column);
if( fmName.width(name) + text_x + lv->itemMargin()*2 > width ) {
int ellWidth = fmName.width( "..." );
QString text = QString::fromLatin1("");
int i = 0;
int len = name.length();
while ( i < len && fmName.width( text + name[ i ] ) + ellWidth < width - text_x - lv->itemMargin()*2 ) {
text += name[ i ];
i++;
}
name = text + "...";
}
int textHeight = fm.lineSpacing() + lv->itemMargin() + 1;
pBuf.drawText( text_x, 0, width, textHeight, AlignVCenter, name );
//End the draw
pBuf.end();
p->drawPixmap( 0, 0, buffer );
}
/* Amarok source code
bool detailedView = PlaylistBrowser::instance()->viewMode() == PlaylistBrowser::DetailedView;
//flicker-free drawing
static QPixmap buffer;
buffer.resize( width, height() );
if( buffer.isNull() ) {
KListViewItem::paintCell( p, cg, column, width, align );
return;
}
QPainter pBuf( &buffer, true );
// use alternate background
pBuf.fillRect( buffer.rect(), isSelected() ? cg.highlight() : backgroundColor() );
if( detailedView ) {
// draw a line at the top
pBuf.setPen( cg.text() );
pBuf.drawLine( 0, 0, width, 0 );
}
KListView *lv = (KListView *)listView();
QRect rect( ((lv->treeStepSize()-9) / 2) + 1, (height()-9) / 2, 9, 9 );
if( m_loading && m_loadingPix ) {
pBuf.drawPixmap( (lv->treeStepSize() - m_loadingPix->width())/2,
(height() - m_loadingPix->height())/2,
*m_loadingPix );
}
else if( m_trackCount ) {
//draw +/- symbol to expande/collapse the playlist
pBuf.setPen( cg.mid() );
pBuf.drawRect( rect );
//fill the rect with base color if the item has alternate color and viceversa
QColor color = backgroundColor() == lv->alternateBackground() ? cg.base() : lv->alternateBackground();
pBuf.fillRect( rect.x()+1, rect.y()+1, rect.width()-2, rect.height()-2, color );
// +/- drawing
pBuf.setPen( cg.text() );
pBuf.drawLine( rect.x()+2, rect.y()+4, rect.x()+6, rect.y()+4 );
if( !isOpen() )
pBuf.drawLine( rect.x()+4, rect.y()+2, rect.x()+4, rect.y()+6 );
}
QFont font( p->font() );
QFontMetrics fm( p->fontMetrics() );
// Use underlined font for "Current Playlist"
if ( m_url.protocol() == "cur" )
font.setUnderline( true );
// Use italic font for "Cool-Streams"
if ( text( 0 ) == "Cool-Streams" )
font.setItalic( true );
int text_x = lv->treeStepSize() + 3;
int textHeight = detailedView ? fm.lineSpacing() + lv->itemMargin() + 1 : height();
pBuf.setPen( isSelected() ? cg.highlightedText() : cg.text() );
//if the playlist has been modified a save icon is shown
if( m_modified && m_savePix ) {
pBuf.drawPixmap( text_x, (textHeight - m_savePix->height())/2, *m_savePix );
text_x += m_savePix->width()+4;
} else if( pixmap(0) ) {
int y = (textHeight - pixmap(0)->height())/2;
if( detailedView ) y++;
pBuf.drawPixmap( text_x, y, *pixmap(0) );
text_x += pixmap(0)->width()+4;
}
// draw the playlist name in bold
font.setBold( PlaylistBrowser::instance()->viewMode() == PlaylistBrowser::DetailedView );
pBuf.setFont( font );
QFontMetrics fmName( font );
QString name = text(0);
if( fmName.width( name ) + text_x + lv->itemMargin()*2 > width ) {
int ellWidth = fmName.width( "..." );
QString text = QString::fromLatin1("");
int i = 0;
int len = name.length();
while ( i < len && fmName.width( text + name[ i ] ) + ellWidth < width - text_x - lv->itemMargin()*2 ) {
text += name[ i ];
i++;
}
name = text + "...";
}
pBuf.drawText( text_x, 0, width, textHeight, AlignVCenter, name );
if( detailedView ) {
QString info;
text_x = lv->treeStepSize() + 3;
font.setBold( false );
pBuf.setFont( font );
if ( m_url.protocol() != "cur" )
{
if( m_loading )
info = i18n( "Loading..." );
else
{ //playlist loaded
// draw the number of tracks and the total length of the playlist
info += i18n("1 Track", "%n Tracks", m_trackCount);
if( m_length )
info += QString(" - [%2]").arg( MetaBundle::prettyTime( m_length ) );
}
pBuf.drawText( text_x, textHeight, width, fm.lineSpacing(), AlignVCenter, info);
}
}
pBuf.end();
p->drawPixmap( 0, 0, buffer );
*/

@ -0,0 +1,75 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef LOG_LIST_ITEM_H
#define LOG_LIST_ITEM_H
#include <qobject.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qpixmap.h>
#include <qmap.h>
#include <qregexp.h>
#include <kiconloader.h>
#include <kurl.h>
#include <klistview.h>
#include "globals.h"
#include "logLine.h"
class LogLine;
class LogMode;
class XorgLogLine;
/**
* @author Nicolas Ternisien
*/
class LogListItem : public KListViewItem {
public:
LogListItem(QListView* list, LogLine* l);
LogListItem(QListViewItem* parent, LogLine* l);
~LogListItem();
QDateTime& getTime();
virtual int compare(QListViewItem * i, int col, bool ascending) const;
QString getFormattedText();
QString getToolTipText();
LogLine* getLogLine();
virtual void paintCell(QPainter* p, const QColorGroup &cg, int column, int width, int align);
QString exportToText();
protected:
LogLine* line;
};
#endif //LOG_LIST_ITEM_H

@ -0,0 +1,600 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qclipboard.h>
//KDE includes
#include <kpopupmenu.h>
#include <kdebug.h>
#include <klocale.h>
#include <kapplication.h>
#include <kio/netaccess.h>
#include <kfilterdev.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
//Project includes
#include "logManager.h"
#include "reader.h"
#include "view.h"
#include "ksystemlog.h"
#include "readerFactory.h"
#include "loadingDialog.h"
LogManager::LogManager(KSystemLog* m, LoadingDialog* progress) :
main(m),
loadingDialog(progress),
reader(NULL),
view(NULL),
groupBy(NO_GROUP_BY),
groupByColumn(-1),
columns(NULL),
sortOrder(Qt::Ascending),
sortColumn(0),
tooltipEnabled(true),
newLinesDisplayed(true),
parsingPaused(false),
logFiles(),
current(false),
newLinesSinceLastSelection(0),
lastUpdate(QTime::currentTime()),
logMode(Globals::noMode) {
//TODO Create the view from a factory for example
view=new View(main);
view->setLogManager(this);
connect(view, SIGNAL(changeStatusbar(const QString&)), this, SLOT(slotChangeStatusbar(const QString&)));
connect(view, SIGNAL(changeCaption(const QString&)), this, SLOT(slotChangeCaption(const QString&)));
connect(view->getLogList(), SIGNAL(doubleClicked(QListViewItem *, const QPoint&, int)), this, SLOT(slotDetails(QListViewItem *, const QPoint&, int)));
connect(view->getLogList(), SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
connect(view->getLogList(), SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), this, SLOT(slotOpenContextualMenu(QListViewItem*, const QPoint&, int)));
}
LogManager::~LogManager() {
//TODO Delete all used object (view and reader)
delete view;
delete reader;
}
View* LogManager::getView() {
return(view);
}
void LogManager::saveConfig() {
view->saveConfig();
}
void LogManager::slotSelectionChanged() {
emit selectionChanged();
}
Reader* LogManager::getReader() {
return(reader);
}
int LogManager::getIndex() {
return(main->getIndex(this));
}
void LogManager::initView() {
if (columns!=NULL)
delete columns;
//Construct columns list
columns=new LogViewColumns();
//Initialize columns list from Reader class
reader->initColumns(columns);
//If groupBy feature is activated, we must draw the tree lines in the view
if (groupBy!=NO_GROUP_BY)
view->getLogList()->setRootIsDecorated(true);
else
view->getLogList()->setRootIsDecorated(false);
view->setColumns(columns);
}
void LogManager::reload() {
loadingDialog->show();
loadingDialog->progressBar()->setProgress(0);
loadingDialog->setLoadingLog(logMode->name);
emit changeStatusbar(i18n("Loading log..."));
kdDebug() << "Reloading " << logMode->name << "..." << endl;
//Change part of the main interface
emit changeTitle(view, logMode->pixmap, logMode->name);
emit changeCaption(logMode->name);
//Empty the current list, to better fill it
clearView();
//Init the Log View
initView();
//Read the log files
reader->readLog();
emit changeStatusbar(i18n("Log successfully loaded."));
//Emit this signal only when the Log List has been totally reloaded
emit reloaded();
loadingDialog->progressBar()->setProgress(100);
loadingDialog->hide();
}
void LogManager::openingProgress(int percent) {
loadingDialog->progressBar()->setProgress(percent);
//Move this signal to Loading Dialog class
emit GUIUpdated();
//((KSystemLog*)( view->parent()))->kapp->processEvents();
}
void LogManager::toggleFilterBar() {
view->toggleFilterBar();
}
void LogManager::slotDetails(QListViewItem *, const QPoint &, int) {
emit detailsCalled();
}
void LogManager::slotChangeCaption(const QString& message) {
emit changeCaption(message);
}
void LogManager::slotChangeStatusbar(const QString& message) {
emit changeStatusbar(message);
}
LogViewColumns* LogManager::getColumns() {
return(columns);
}
void LogManager::clearView() {
view->clearLogList();
}
void LogManager::setLogFiles(LogFiles* files) {
//We first clear the previous list
//TODO Also delete pointers in this list before empty it
logFiles.clear();
LogFiles::Iterator it;
for(it=files->begin(); it!=files->end(); ++it) {
logFiles.append(*it);
}
//The list is (normally) no longer used after that.
delete files;
}
LogFiles& LogManager::getLogFiles() {
return(logFiles);
}
LogMode* LogManager::getLogMode() {
return(logMode);
}
QTime& LogManager::getLastUpdate() {
return(lastUpdate);
}
void LogManager::slotLogUpdated(int lineCount) {
kdDebug() << "Log is updated (from LogManager) : " << lineCount << " current=" << isCurrent() << endl;
if (lineCount==0)
return;
newLinesSinceLastSelection+=lineCount;
lastUpdate=QTime::currentTime();
//Emit this signal even if the current LogManager is selected
emit logUpdated(newLinesSinceLastSelection);
//If the user is in this log manager, he does have to see that some new log lines have appeared
if (isCurrent()==false) {
QString title(i18n("%1 (%2)").arg(logMode->name).arg(newLinesSinceLastSelection));
//This signal is emitted only if the selected tab is not this one
emit changeTitle(view, title);
}
}
void LogManager::slotExpandAll() {
//If this LogManager is the currently displayed one
if (isCurrent()) {
QListViewItem* item=view->getLogList()->firstChild();
while (item!=NULL) {
item->setOpen(true);
item=item->nextSibling();
}
}
}
void LogManager::slotCollapseAll() {
//If this LogManager is the currently displayed one
if (isCurrent()) {
QListViewItem* item=view->getLogList()->firstChild();
while (item!=NULL) {
item->setOpen(false);
item=item->nextSibling();
}
}
}
void LogManager::slotFileSave() {
//If this LogManager is the currently displayed one
if (isCurrent()) {
QListViewItemIterator it(view->getLogList(), QListViewItemIterator::Selected);
//No item selected
if (it.current()==NULL) {
emit changeStatusbar(i18n("No items selected. Please select items to be able to save them."));
return;
}
QString filename = KFileDialog::getSaveFileName(QString::null, QString::null, main);
if (!filename.isEmpty()) {
QIODevice* ioDev = KFilterDev::deviceForFile( filename );
if (ioDev->open(IO_WriteOnly)) {
QTextStream stream(ioDev);
int nbCopied=0;
QListViewItem* qtItem=it.current();
while (qtItem!=NULL) {
LogListItem* item=static_cast<LogListItem*> (qtItem);
//Copy the item content to the stream
stream << item->exportToText();
//Retrieve the next item
it++;
qtItem=it.current();
nbCopied++;
}
ioDev->close();
emit changeStatusbar(i18n("1 log line saved to '%1'.", "%n log lines saved to '%1'.", nbCopied).arg(filename));
}
else {
QString message(i18n("Unable to save file '%1': Permission Denied.").arg(filename));
KMessageBox::error(main, message, i18n("Unable to save file."), KMessageBox::Notify);
}
delete ioDev;
}
}
}
void LogManager::reinitialize() {
//Reinitialize groupBy
groupBy=NO_GROUP_BY;
groupByColumn=-1;
//TODO Reinitialize sorting, order, column order...
}
void LogManager::initialize(LogMode* mode) {
//If this LogManager has already been initialized
//with another LogMode, then it needs to be reinitialized
if (this->logMode!=Globals::noMode)
reinitialize();
//Use now the new mode
this->logMode=mode;
//Find the reader instance used for this new mode
reader=ReaderFactory::createReader(mode);
connect(reader, SIGNAL(statusbarChanged(const QString&)), this, SLOT(slotChangeStatusbar(const QString&)));
connect(reader, SIGNAL(logUpdated(int)), this, SLOT(slotLogUpdated(int)));
connect(reader, SIGNAL(openingProgressed(int)), this, SLOT(openingProgress(int)));
connect(reader, SIGNAL(readingBegin()), this, SLOT(readingBegun()));
connect(reader, SIGNAL(readingFile(int)), this, SLOT(readingFile(int)));
connect(reader, SIGNAL(readingEnd()), this, SLOT(readingEnded()));
//Inform this reader that this LogManager is now its parent
reader->setLogManager(this);
//Find the log files used for this kind of mode, and set them to our log manager
setLogFiles(ReaderFactory::createLogFiles(mode));
}
void LogManager::readingBegun() {
//Inform the Loading Dialog on how many Files we have to load
loadingDialog->setFileCount(logFiles.count());
}
void LogManager::readingFile(int currentFile) {
//Inform the Loading Dialog that there is a new file loading
loadingDialog->setCurrentFile(currentFile);
//Update the Progress Dialog label
loadingDialog->show();
loadingDialog->progressBar()->setProgress(0);
loadingDialog->setLoadingLog(logMode->name);
}
void LogManager::readingEnded() {
//Reposition the count total to its default value
loadingDialog->setFileCount(0);
}
void LogManager::setParsingPaused(bool paused) {
parsingPaused=paused;
//If we resume the parsing, then we reparse the files to know if new lines has append
if (parsingPaused==false) {
if (reader!=NULL) {
reader->relaunchLogChanged();
}
}
}
bool LogManager::isParsingPaused() {
return(parsingPaused);
}
void LogManager::setTooltipEnabled(bool enabled) {
tooltipEnabled=enabled;
}
bool LogManager::isTooltipEnabled() {
return(tooltipEnabled);
}
void LogManager::setCurrent(bool cur) {
current=cur;
//Reinitialize the new line count
newLinesSinceLastSelection=0;
}
bool LogManager::isCurrent() {
return(current);
}
void LogManager::setNewLinesDisplayed(bool displayed) {
newLinesDisplayed=displayed;
}
bool LogManager::isNewLinesDisplayed() {
return(newLinesDisplayed);
}
void LogManager::setGroupBy(groupByType group, int column) {
this->groupBy=group;
this->groupByColumn=column;
}
groupByType LogManager::getGroupBy() {
return(groupBy);
}
int LogManager::getGroupByColumn() {
return(groupByColumn);
}
void LogManager::slotSendMail() {
//If this LogManager is the currently displayed one
if (isCurrent()) {
QString body(i18n("Here are my logs:\n"));
body+=i18n("---------------------------------------\n");
QListViewItemIterator it(view->getLogList(), QListViewItemIterator::Selected);
int i=0;
QListViewItem* qtItem=it.current();
while (qtItem!=NULL) {
LogListItem* item=static_cast<LogListItem*> (qtItem);
body+= item->exportToText();
body+='\n';
++it;
qtItem=it.current();
++i;
}
body+=i18n("---------------------------------------\n");
//Too much lines selected
if (i>1000) {
KMessageBox::sorry(main, i18n("You have selected too many lines. Please only select important log lines."), i18n("Too Many Lines Selected"));
return;
}
/* Parameters list of this method
const QString & to,
const QString & cc,
const QString & bcc,
const QString & subject,
const QString & body,
const QString & messageFile,
const QStringList & attachURLs,
const QCString & startup_id
*/
kapp->invokeMailer("", "", "", i18n("Log Lines of my problem"), body, "", QStringList(), kapp->startupId());
}
}
void LogManager::slotCopyToClipboard() {
//If this LogManager is the currently displayed one
if (isCurrent()) {
kdDebug() << "Copy to the clipboard" << endl;
QListView* listView=view->getLogList();
QListViewItemIterator it(listView, QListViewItemIterator::Selected);
int nbCopied=0;
LogListItem* item=static_cast<LogListItem*> (it.current());
QString text;
while (item!=NULL) {
//Copy the item content to the text string
text.append(item->exportToText());
text.append('\n');
//Retrieve the next value
it++;
item=static_cast<LogListItem*> (it.current());
nbCopied++;
}
//Copy text value only if it is not empty
if (nbCopied==0) {
emit changeStatusbar(i18n("No items selected. Nothing copied to clipboard."));
}
else {
//Copy both to clipboard and X11-selection
QApplication::clipboard()->setText(text, QClipboard::Clipboard);
QApplication::clipboard()->setText(text, QClipboard::Selection);
emit changeStatusbar(i18n("1 log line copied to clipboard.", "%n log lines copied to clipboard.", nbCopied));
}
}
}
void LogManager::synchronize(LogLineList* buffer) {
kdDebug() << "Synchronizing the buffer..." << endl;
//Here to find a fucking bug
if (buffer==NULL)
kdDebug() << "ERROR! Buffer NULL" << endl;
else
kdDebug() << "Buffer not NULL" << endl;
//Here to find a fucking bug
if (view==NULL)
kdDebug() << "ERROR! View NULL" << endl;
else
kdDebug() << "View not NULL" << endl;
//Synchronize the buffer returned by the reader and get the last added line
LogLine* line=buffer->synchronize(view);
//Here to find a fucking bug
if (line==NULL)
kdDebug() << "ERROR! Line NULL" << endl;
else
kdDebug() << "Line not NULL" << endl;
//Here to find a fucking bug
if (view->getLogList()==NULL)
kdDebug() << "ERROR! KListView NULL" << endl;
else
kdDebug() << "KListView not NULL" << endl;
if (isNewLinesDisplayed()==true) {
if (line!=NULL) {
line->ensureItemVisible(view->getLogList());
}
}
kdDebug() << "Buffer synchronized." << endl;
}
//TODO Change the method name
void LogManager::slotOpenContextualMenu(QListViewItem* /*item*/, const QPoint& pos, int /*other*/) {
QPopupMenu menu(main);
main->actionCollection()->action("reload")->plug(&menu);
main->actionCollection()->action("select_all")->plug(&menu);
menu.insertSeparator();
main->actionCollection()->action("copy")->plug(&menu);
main->actionCollection()->action("file_save")->plug(&menu);
menu.insertSeparator();
main->actionCollection()->action("enable_tooltip")->plug(&menu);
main->actionCollection()->action("display_new_line")->plug(&menu);
main->actionCollection()->action("group_by")->plug(&menu);
menu.insertSeparator();
main->actionCollection()->action("details")->plug(&menu);
menu.exec(pos);
}
#include "logManager.moc"

@ -0,0 +1,201 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef LOG_MANAGER_H
#define LOG_MANAGER_H
//Qt includes
#include <qobject.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qdatetime.h>
#include <qlistview.h>
#include <qptrlist.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
//KDE includes
#include <kurl.h>
//Project includes
#include "globals.h"
#include "logLineList.h"
#include "logMode.h"
#include "logFile.h"
#include "logViewColumns.h"
class Reader;
class View;
class KSystemLog;
class LoadingDialog;
class LogManager;
typedef QPtrList<LogManager> LogManagers;
/**
* @author Nicolas Ternisien
* TODO !!!!!!!!!!!!! Separate OpeningFileName from LogManager !!!!!!!!!!!!
*/
class LogManager : public QObject {
Q_OBJECT
public:
LogManager(KSystemLog* main, LoadingDialog* progress);
virtual ~LogManager();
View* getView();
Reader* getReader();
groupByType getGroupBy();
int getGroupByColumn();
QTime& getLastUpdate();
LogMode* getLogMode();
void initialize(LogMode* mode);
void setParsingPaused(bool paused);
bool isParsingPaused();
void setTooltipEnabled(bool enabled);
bool isTooltipEnabled();
void setNewLinesDisplayed(bool displayed);
bool isNewLinesDisplayed();
void clearView();
int getIndex();
void setGroupBy(groupByType group, int column=-1);
void setCurrent(bool cur);
bool isCurrent();
LogViewColumns* getColumns();
void reload();
void setLogFiles(LogFiles* files);
LogFiles& getLogFiles();
void synchronize(LogLineList* buffer);
void toggleFilterBar();
void saveConfig();
protected:
void reinitialize();
void initView();
public slots:
void slotExpandAll();
void slotCollapseAll();
void slotCopyToClipboard();
void slotFileSave();
void slotSendMail();
protected slots:
//TODO Change the method name
void slotOpenContextualMenu(QListViewItem *item, const QPoint& pos, int value);
//Redirect the openingProgressed signal from Reader to connected object
void openingProgress(int percent);
void slotLogUpdated(int lineCount);
void slotSelectionChanged();
void slotChangeCaption(const QString& message);
void slotChangeStatusbar(const QString& message);
void slotDetails(QListViewItem *, const QPoint &, int);
void readingBegun();
void readingFile(int currentFile);
void readingEnded();
signals:
void changeTitle(View* view, const QString& label);
void changeTitle(View* view, const QIconSet& icon, const QString& label);
void changeCaption(const QString& caption);
void changeStatusbar(const QString& message);
void detailsCalled();
void GUIUpdated();
void selectionChanged();
void reloaded();
void logUpdated(int);
protected:
KSystemLog* main;
QTime lastUpdate;
LogMode* logMode;
bool sortOrder;
int sortColumn;
bool newLinesDisplayed;
bool parsingPaused;
bool tooltipEnabled;
LogFiles logFiles;
bool current;
int newLinesSinceLastSelection;
LoadingDialog* loadingDialog;
Reader* reader;
View* view;
groupByType groupBy;
int groupByColumn;
LogViewColumns* columns;
};
#endif //LOG_MANAGER_H

@ -0,0 +1,45 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <kiconloader.h>
#include "logMode.h"
LogMode::LogMode(int id, QString& nm, QString& ic) :
id(id),
name(nm),
icon(ic),
pixmap(SmallIcon(ic)) {
}
LogMode::LogMode(int id, QString name, const char* ic) :
id(id),
name(name),
icon(ic),
pixmap(SmallIcon(ic)) {
}
LogMode::~LogMode() {
}

@ -0,0 +1,64 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef LOG_MODE_H
#define LOG_MODE_H
#include <qobject.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <qptrlist.h>
#include <kurl.h>
#include "globals.h"
class LogMode;
typedef QPtrList<LogMode> LogModes;
/**
* @author Nicolas Ternisien
*/
class LogMode {
public:
LogMode(int id, QString& name, QString& icon);
LogMode(int id, QString name, const char* icon);
virtual ~LogMode();
int id;
QString name;
QString icon;
QPixmap pixmap;
};
#endif //LOG_MODE_H

@ -0,0 +1,41 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <kiconloader.h>
#include "logViewColumn.h"
LogViewColumn::LogViewColumn(QString& name, bool filtred, bool grouped) :
columnName(name),
isFiltred(filtred),
isGrouped(grouped) {
}
LogViewColumn::LogViewColumn(QString name, bool filtred, bool grouped) :
columnName(name),
isFiltred(filtred),
isGrouped(grouped) {
}
LogViewColumn::~LogViewColumn() {
}

@ -0,0 +1,54 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef LOG_VIEW_COLUMN_H
#define LOG_VIEW_COLUMN_H
#include <qobject.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <kurl.h>
#include "globals.h"
/**
* @author Nicolas Ternisien
*/
class LogViewColumn {
public:
LogViewColumn(QString& name, bool filtred=true, bool grouped=true);
LogViewColumn(QString name, bool filtred=true, bool grouped=true);
virtual ~LogViewColumn();
QString columnName;
bool isFiltred;
bool isGrouped;
};
#endif //LOG_VIEW_COLUMN_H

@ -0,0 +1,65 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "logViewColumns.h"
LogViewColumns::LogViewColumns() :
QValueVector<LogViewColumn*>(),
groupByLogLevel(true),
groupByDay(true),
groupByHour(true),
groupByLogFile(true) {
}
void LogViewColumns::setGroupByLogLevel(bool value) {
groupByLogLevel=value;
}
void LogViewColumns::setGroupByDay(bool value) {
groupByDay=value;
}
void LogViewColumns::setGroupByHour(bool value) {
groupByHour=value;
}
void LogViewColumns::setGroupByLogFile(bool value) {
groupByLogFile=value;
}
bool LogViewColumns::isGroupByLogLevel() {
return(groupByLogLevel);
}
bool LogViewColumns::isGroupByDay() {
return(groupByDay);
}
bool LogViewColumns::isGroupByHour() {
return(groupByHour);
}
bool LogViewColumns::isGroupByLogFile() {
return(groupByLogFile);
}

@ -0,0 +1,63 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _LOG_VIEW_COLUMNS_H_
#define _LOG_VIEW_COLUMNS_H_
#include <qobject.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <kurl.h>
#include "globals.h"
#include "logViewColumn.h"
/**
* @author Nicolas Ternisien
*/
class LogViewColumns : public QValueVector<LogViewColumn*> {
public:
LogViewColumns();
bool isGroupByLogLevel();
bool isGroupByDay();
bool isGroupByHour();
bool isGroupByLogFile();
void setGroupByLogLevel(bool value);
void setGroupByDay(bool value);
void setGroupByHour(bool value);
void setGroupByLogFile(bool value);
private:
bool groupByLogLevel;
bool groupByDay;
bool groupByHour;
bool groupByLogFile;
};
#endif

@ -0,0 +1,246 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
//KDE includes
#include <klocale.h>
#include <kurlrequester.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kdebug.h>
#include <kprocess.h>
#include <kmessagebox.h>
//Project includes
#include "logLevel.h"
#include "globals.h"
#include "loggerDialog.h"
LoggerDialog::LoggerDialog(QWidget *parent, const char *name) :
LoggerDialogBase(parent, name) {
connect(buttonOK, SIGNAL(clicked()), this, SLOT(sendMessage()));
connect(tagActivation, SIGNAL(toggled(bool)), this, SLOT(tagActivationChanged(bool)));
connect(fileActivation, SIGNAL(toggled(bool)), this, SLOT(fileActivationChanged(bool)));
connect(messageActivation, SIGNAL(toggled(bool)), this, SLOT(messageActivationChanged(bool)));
connect(file, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)));
connect(message, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)));
connect(tag, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)));
buildMaps();
//Fill the priority ComboBox
QValueList<QString> prioKeys(priorities.keys());
QValueList<QString>::Iterator itPriority;
for (itPriority=prioKeys.begin(); itPriority!=prioKeys.end(); ++itPriority) {
priority->insertItem(priorityIcons[*itPriority], *itPriority);
}
//Select the right priority
for (int i=0; i<priority->count(); ++i) {
if (priority->text(i)==Globals::noticeLogLevel->name) {
priority->setCurrentItem(i);
break;
}
}
//Fill the priority ComboBox
QValueList<QString> keys(facilities.keys());
QValueList<QString>::Iterator itFacility;
for (itFacility=keys.begin(); itFacility!=keys.end(); ++itFacility) {
facility->insertItem(*itFacility);
}
//Select the right facility
for (int i=0; i<facility->count(); ++i) {
if (facility->text(i)==i18n("User")) {
facility->setCurrentItem(i);
break;
}
}
}
void LoggerDialog::buildMaps() {
//Fill the facility map
facilities[i18n("Authentication")]="auth";
facilities[i18n("Private Authentication")]="authpriv";
facilities[i18n("Cron")]="cron";
facilities[i18n("Daemon")]="daemon";
facilities[i18n("FTP")]="ftp";
facilities[i18n("Kernel")]="kern";
facilities[i18n("LPR")]="lpr";
facilities[i18n("Mail")]="mail";
facilities[i18n("News")]="news";
facilities[i18n("Syslog")]="syslog";
facilities[i18n("User")]="user";
facilities[i18n("UUCP")]="uucp";
facilities[i18n("Local 0")]="local0";
facilities[i18n("Local 1")]="local1";
facilities[i18n("Local 2")]="local2";
facilities[i18n("Local 3")]="local3";
facilities[i18n("Local 4")]="local4";
facilities[i18n("Local 5")]="local5";
facilities[i18n("Local 6")]="local6";
facilities[i18n("Local 7")]="local7";
//Fill the priority map
priorities[Globals::debugLogLevel->name]="debug";
priorities[Globals::informationLogLevel->name]="info";
priorities[Globals::noticeLogLevel->name]="notice";
priorities[Globals::warningLogLevel->name]="warning";
priorities[Globals::errorLogLevel->name]="err";
priorities[Globals::criticalLogLevel->name]="crit";
priorities[Globals::alertLogLevel->name]="alert";
priorities[Globals::emergencyLogLevel->name]="emerg";
//Fill the priority icon map
priorityIcons[Globals::debugLogLevel->name]=Globals::debugLogLevel->pixmap;
priorityIcons[Globals::informationLogLevel->name]=Globals::informationLogLevel->pixmap;
priorityIcons[Globals::noticeLogLevel->name]=Globals::noticeLogLevel->pixmap;
priorityIcons[Globals::warningLogLevel->name]=Globals::warningLogLevel->pixmap;
priorityIcons[Globals::errorLogLevel->name]=Globals::errorLogLevel->pixmap;
priorityIcons[Globals::criticalLogLevel->name]=Globals::criticalLogLevel->pixmap;
priorityIcons[Globals::alertLogLevel->name]=Globals::alertLogLevel->pixmap;
priorityIcons[Globals::emergencyLogLevel->name]=Globals::emergencyLogLevel->pixmap;
}
void LoggerDialog::textChanged(const QString& /*text*/) {
if (fileActivation->isChecked() && file->url().isEmpty()) {
buttonOK->setEnabled(false);
return;
}
if (tagActivation->isChecked() && tag->text().isEmpty()) {
buttonOK->setEnabled(false);
return;
}
if (messageActivation->isChecked() && message->text().isEmpty()) {
buttonOK->setEnabled(false);
return;
}
buttonOK->setEnabled(true);
}
void LoggerDialog::tagActivationChanged(bool activation) {
tag->setEnabled(activation);
textChanged("");
}
void LoggerDialog::fileActivationChanged(bool activation) {
file->setEnabled(activation);
textChanged("");
}
void LoggerDialog::messageActivationChanged(bool activation) {
message->setEnabled(activation);
textChanged("");
}
void LoggerDialog::sendMessage() {
KProcess process;
//process.setUseShell(true);
process << "logger";
if (useProcessIdentifier->isChecked()) {
process << "-i";
}
if (tagActivation->isChecked()) {
process << "-t";
process << tag->text();
}
QString prioritySelected=priority->currentText();
if (prioritySelected!=Globals::noneLogLevel->name) {
process << "-p";
QString p(facilities[facility->currentText()]);
p+=".";
p+=priorities[priority->currentText()];
process << p;
}
//If we read the content of a file
if (fileActivation->isChecked()) {
process << "-f";
process << file->url();
}
//Else, the user types the content of its message
else {
//Remove bad "\n" characters
QString msg=message->text().replace("\n", " ");
process << msg;
}
bool launch=process.start( KProcess::Block, KProcess::Stdout );
//If the launching of the command failed
if (launch==false) {
KMessageBox::error(this, i18n("Unable to find the 'logger' command on your system. Please type 'logger' in Konsole to be sure that this command does not exist."), i18n("Command not found"), KMessageBox::Error);
return;
}
if (process.normalExit()==false) {
KMessageBox::error(this, i18n("The 'logger' command has not been properly exited."), i18n("Execution problem"), KMessageBox::Error);
return;
}
int returnCode=process.exitStatus();
//No such file or directory
if (returnCode==1) {
KMessageBox::error(this, i18n("This file does not exist. Please choose a right file."), i18n("File not valid"), KMessageBox::Error);
return;
}
//Hide the Logger Dialog
hide();
}
#include "loggerDialog.moc"

@ -0,0 +1,55 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef LOGGER_DIALOG_H
#define LOGGER_DIALOG_H
#include <qmap.h>
#include <qpixmap.h>
#include "loggerDialogBase.h"
class LoggerDialog: public LoggerDialogBase {
Q_OBJECT
public:
LoggerDialog(QWidget *parent = 0, const char *name = 0);
protected slots:
void sendMessage();
void textChanged(const QString&);
void tagActivationChanged(bool activation);
void fileActivationChanged(bool activation);
void messageActivationChanged(bool activation);
protected:
void buildMaps();
QMap<QString, QString> facilities;
QMap<QString, QString> priorities;
QMap<QString, QPixmap> priorityIcons;
};
#endif

@ -0,0 +1,453 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>LoggerDialogBase</class>
<comment>Dialog that allows the user to send a message with the logger command</comment>
<author>Nicolas Ternisien</author>
<widget class="QDialog">
<property name="name">
<cstring>loggerDialogBase</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>475</width>
<height>362</height>
</rect>
</property>
<property name="baseSize">
<size>
<width>300</width>
<height>300</height>
</size>
</property>
<property name="caption">
<string>Log Message</string>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QButtonGroup">
<property name="name">
<cstring>buttonGroup1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Message</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="2">
<property name="name">
<cstring>message</cstring>
</property>
<property name="lineWidth">
<number>2</number>
</property>
</widget>
<widget class="QRadioButton" row="0" column="0">
<property name="name">
<cstring>messageActivation</cstring>
</property>
<property name="text">
<string>&amp;Message:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="KURLRequester" row="1" column="2">
<property name="name">
<cstring>file</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>fileActivation</cstring>
</property>
<property name="text">
<string>&amp;File Content:</string>
</property>
</widget>
</grid>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox1</cstring>
</property>
<property name="title">
<string>Properties</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="1" column="0">
<property name="name">
<cstring>layout9_2</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2_2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Facility:</string>
</property>
<property name="buddy" stdset="0">
<cstring>facility</cstring>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer3_2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>84</width>
<height>24</height>
</size>
</property>
</spacer>
<widget class="KComboBox">
<property name="name">
<cstring>facility</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget" row="0" column="0">
<property name="name">
<cstring>layout9</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Priority:</string>
</property>
<property name="buddy" stdset="0">
<cstring>priority</cstring>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer3_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>84</width>
<height>24</height>
</size>
</property>
</spacer>
<widget class="KComboBox">
<property name="name">
<cstring>priority</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</hbox>
</widget>
</grid>
</widget>
<widget class="QButtonGroup">
<property name="name">
<cstring>options</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Options</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="3" column="0">
<property name="name">
<cstring>layout11</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>tagActivation</cstring>
</property>
<property name="focusPolicy">
<enum>TabFocus</enum>
</property>
<property name="text">
<string>&amp;Tag:</string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer3_2_2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>100</width>
<height>24</height>
</size>
</property>
</spacer>
<widget class="KLineEdit">
<property name="name">
<cstring>tag</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>5</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</hbox>
</widget>
<widget class="QCheckBox" row="4" column="0">
<property name="name">
<cstring>useProcessIdentifier</cstring>
</property>
<property name="text">
<string>Log Process &amp;Identifier</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</grid>
</widget>
<spacer>
<property name="name">
<cstring>spacer7</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>31</width>
<height>41</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout6</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="KActiveLabel">
<property name="name">
<cstring>loggerManual</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;qt&gt;&lt;a href="man:/logger"&gt;Logger Manual&lt;/a&gt;&lt;/qt&gt;</string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>Horizontal Spacing2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>155</width>
<height>26</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>buttonOK</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;OK</string>
</property>
<property name="accel">
<string></string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonCancel</cstring>
</property>
<property name="text">
<string>&amp;Cancel</string>
</property>
<property name="accel">
<string></string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>buttonCancel</sender>
<signal>clicked()</signal>
<receiver>loggerDialogBase</receiver>
<slot>accept()</slot>
</connection>
<connection>
<sender>tagActivation</sender>
<signal>pressed()</signal>
<receiver>tag</receiver>
<slot>&lt;No)</slot>
</connection>
</connections>
<tabstops>
<tabstop>useProcessIdentifier</tabstop>
<tabstop>buttonOK</tabstop>
<tabstop>buttonCancel</tabstop>
<tabstop>loggerManual</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klineedit.h</includehint>
<includehint>kurlrequester.h</includehint>
<includehint>klineedit.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>kcombobox.h</includehint>
<includehint>klineedit.h</includehint>
<includehint>kactivelabel.h</includehint>
</includehints>
</UI>

@ -0,0 +1,90 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "ksystemlog.h"
#include <kapplication.h>
#include <dcopclient.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
static const char description[]=I18N_NOOP("System Logs Viewer Tool for KDE");
static const char version[]="0.3.2";
static KCmdLineOptions options[] = {
{ "+[URL]", I18N_NOOP( "Document to open" ), 0 },
KCmdLineLastOption
};
int main(int argc, char **argv) {
KAboutData about( "ksystemlog",
I18N_NOOP("KSystemlog"),
version,
description,
KAboutData::License_GPL,
"(C) 2005, Nicolas Ternisien",
0,
0,
"nicolas.ternisien@gmail.com"
);
about.addAuthor("Nicolas Ternisien", 0, "nicolas.ternisien@gmail.com" );
about.addCredit("Patrick Decker", I18N_NOOP("Ideas, Code improvements" ), "patrick@decker.org" );
//about.addCredit(I18N_NOOP("French trains between Paris and Rouen"), I18N_NOOP("Often late, so I have time to improve KSystemLog ;-)" ), "info@sncf.fr" );
KCmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
//Register ourselves as a DCOP client
app.dcopClient()->registerAs(app.name(), false);
//See if we are starting with session management
if (app.isRestored()) {
RESTORE(KSystemLog);
}
else {
//No session... Just start up normally
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->count() == 0) {
KSystemLog *widget = new KSystemLog();
widget->show();
}
else {
int i = 0;
for (; i < args->count(); i++) {
KSystemLog *widget = new KSystemLog();
widget->show();
//Useless
//widget->load(args->url(i));
}
}
args->clear();
}
return(app.exec());
}

@ -0,0 +1,425 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <qlayout.h>
#include <qlabel.h>
#include <klocale.h>
#include <kdialogbase.h>
#include <kiconloader.h>
#include <kapplication.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include "ksystemlogConfig.h"
#include "options.h"
Options::Options(QWidget* parent, const char *name, bool modal) :
KDialogBase(IconList, i18n("Configuration"), Ok|Apply|Cancel, Ok, parent, name, modal, true)
{
this->setMinimumSize(480, 500);
setupGeneralOptions();
setupSystemOptions();
setupBootAuthenticationOptions();
setupKernelOptions();
setupCronOptions();
setupDaemonOptions();
setupXorgOptions();
setupAcpidOptions();
setupCupsOptions();
setupApacheOptions();
setupPostfixOptions();
disableApplyButton();
connect(this, SIGNAL(applyClicked()), this, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), this, SLOT(saveConfig()));
//Really update size of this Configuration Dialog Box
this->adjustSize();
}
Options::~Options() {
//TODO Delete option frames
}
void Options::disableApplyButton() {
this->enableButtonApply(false);
}
void Options::saveConfig() {
kdDebug() << "Saving config from Main Config Dialog..." << endl;
KSystemLogConfig::writeConfig();
kdDebug() << "Configuration synchronized" << endl;
disableApplyButton();
}
void Options::setupGeneralOptions() {
QFrame* frame=addPage(i18n("General"), i18n("General"), DesktopIcon(KSYSTEMLOG_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container = new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
generalOptions = new GeneralOptions(container->viewport());
container->addChild(generalOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(generalOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), generalOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), generalOptions, SLOT(saveConfig()));
}
void Options::setupBootAuthenticationOptions() {
QFrame* frame=addPage(i18n("Boot / Authentication"), i18n("Boot & Authentication Logs"), DesktopIcon(BOOT_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container = new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
bootAuthenticationOptions = new BootAuthenticationOptions(container->viewport());
container->addChild(bootAuthenticationOptions, 0, 0);
connect(bootAuthenticationOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), bootAuthenticationOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), bootAuthenticationOptions, SLOT(saveConfig()));
}
void Options::setupSystemOptions() {
QFrame* frame=addPage(i18n("System Log"), i18n("System Log"), DesktopIcon(SYSTEM_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
systemOptions=new SystemOptions(container->viewport());
container->addChild(systemOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(systemOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), systemOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), systemOptions, SLOT(saveConfig()));
}
void Options::setupKernelOptions() {
QFrame* frame=addPage(i18n("Kernel Log"), i18n("Kernel Log"), DesktopIcon(KERNEL_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
kernelOptions=new KernelOptions(container->viewport());
container->addChild(kernelOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(kernelOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), kernelOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), kernelOptions, SLOT(saveConfig()));
}
void Options::setupCronOptions() {
QFrame* frame=addPage(i18n("Cron Log"), i18n("Cron Log"), DesktopIcon(CRON_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
cronOptions=new CronOptions(container->viewport());
container->addChild(cronOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(cronOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), cronOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), cronOptions, SLOT(saveConfig()));
}
void Options::setupDaemonOptions() {
QFrame* frame=addPage(i18n("Daemons Log"), i18n("Daemons Log"), DesktopIcon(DAEMON_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
daemonOptions=new DaemonOptions(container->viewport());
container->addChild(daemonOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(daemonOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), daemonOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), daemonOptions, SLOT(saveConfig()));
}
void Options::setupXorgOptions() {
QFrame* frame=addPage(i18n("X.org Log"), i18n("X.org Log"), DesktopIcon(XORG_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
xorgOptions=new XorgOptions(container->viewport());
container->addChild(xorgOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(xorgOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), xorgOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), xorgOptions, SLOT(saveConfig()));
}
void Options::setupAcpidOptions() {
QFrame* frame=addPage(i18n("ACPI Log"), i18n("ACPI Daemon Log"), DesktopIcon(ACPID_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
acpidOptions=new AcpidOptions(container->viewport());
container->addChild(acpidOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(acpidOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), acpidOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), acpidOptions, SLOT(saveConfig()));
}
void Options::setupCupsOptions() {
QFrame* frame=addPage(i18n("CUPS Log"), i18n("CUPS & CUPS Web Server Log"), DesktopIcon(CUPS_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
cupsOptions=new CupsOptions(container->viewport());
container->addChild(cupsOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(cupsOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), cupsOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), cupsOptions, SLOT(saveConfig()));
}
void Options::setupApacheOptions() {
QFrame* frame=addPage(i18n("Apache Log"), i18n("Apache and Web Access Logs"), DesktopIcon(APACHE_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
apacheOptions=new ApacheOptions(container->viewport());
container->addChild(apacheOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(apacheOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), apacheOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), apacheOptions, SLOT(saveConfig()));
}
void Options::setupPostfixOptions() {
QFrame* frame=addPage(i18n("Postfix Log"), i18n("Postfix Log"), DesktopIcon(POSTFIX_MODE_ICON));
QGridLayout* frameLayout=new QGridLayout(frame);
frameLayout->setSpacing(0);
frameLayout->setMargin(0);
frameLayout->setAutoAdd(true);
QScrollView* container=new QScrollView(frame);
container->setResizePolicy(QScrollView::AutoOneFit);
container->setFrameShadow(QScrollView::Plain);
container->setFrameShape(QScrollView::MenuBarPanel);
container->setLineWidth(0);
container->setMidLineWidth(0);
postfixOptions=new PostfixOptions(container->viewport());
container->addChild(postfixOptions, 0, 0);
//Done by the setAutoAdd method
//frameLayout->addWidget(container, 0, 0, 0);
connect(postfixOptions, SIGNAL(optionsChanged(bool)), this, SLOT(optionsChanged(bool)));
connect(this, SIGNAL(applyClicked()), postfixOptions, SLOT(saveConfig()));
connect(this, SIGNAL(okClicked()), postfixOptions, SLOT(saveConfig()));
}
void Options::optionsChanged(bool valid) {
if (valid==false) {
this->enableButtonApply(false);
this->enableButtonOK(false);
}
else {
//If all tab options are valid, then, we reactivate the Apply and OK buttons
if (generalOptions->isValid() &&
systemOptions->isValid() &&
cronOptions->isValid() &&
daemonOptions->isValid() &&
kernelOptions->isValid() &&
xorgOptions->isValid() &&
acpidOptions->isValid() &&
cupsOptions->isValid() &&
bootAuthenticationOptions->isValid()) {
this->enableButtonApply(true);
this->enableButtonOK(true);
}
else {
this->enableButtonApply(true);
this->enableButtonOK(true);
}
}
}
#include "options.moc"

@ -0,0 +1,101 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef OPTIONS_H
#define OPTIONS_H
#include <qframe.h>
#include <qspinbox.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include "globals.h"
#include "generalOptions.h"
#include "systemOptions.h"
#include "kernelOptions.h"
#include "cronOptions.h"
#include "daemonOptions.h"
#include "xorgOptions.h"
#include "bootAuthenticationOptions.h"
#include "acpidOptions.h"
#include "cupsOptions.h"
#include "apacheOptions.h"
#include "postfixOptions.h"
class Options: public KDialogBase {
Q_OBJECT
public:
Options(QWidget *parent, const char *name, bool modal);
~Options();
public slots:
void saveConfig();
void optionsChanged(bool valid);
void disableApplyButton();
private:
GeneralOptions* generalOptions;
SystemOptions* systemOptions;
KernelOptions* kernelOptions;
CronOptions* cronOptions;
DaemonOptions* daemonOptions;
XorgOptions* xorgOptions;
BootAuthenticationOptions* bootAuthenticationOptions;
AcpidOptions* acpidOptions;
CupsOptions* cupsOptions;
ApacheOptions* apacheOptions;
PostfixOptions* postfixOptions;
void setupGeneralOptions();
void setupSystemOptions();
void setupKernelOptions();
void setupCronOptions();
void setupDaemonOptions();
void setupXorgOptions();
void setupBootAuthenticationOptions();
void setupAcpidOptions();
void setupCupsOptions();
void setupApacheOptions();
void setupPostfixOptions();
};
#endif //OPTIONS_H

@ -0,0 +1,162 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <kdebug.h>
#include "parentLogLine.h"
ParentLogLine::ParentLogLine(
QDate& date, QTime& time, QStringList& list, QString& file, LogLevel* level, int type,
groupByType group, int column, LogViewColumns* cols) :
LogLine(date, time, list, file, level, type),
groupBy(group),
groupByColumn(column),
columns(cols) {
}
ParentLogLine::~ParentLogLine() {
}
groupByType ParentLogLine::getGroupBy() {
return(groupBy);
}
int ParentLogLine::getGroupByColumn() {
return(groupByColumn);
}
LogViewColumns* ParentLogLine::getColumns() {
return(columns);
}
void ParentLogLine::addChild(LogLine* child) {
children.append(child);
}
bool ParentLogLine::isParentLogLine() {
return(true);
}
bool ParentLogLine::isChild(LogLine* child) {
//Group by Log Level
if (groupBy==GROUP_BY_LOG_LEVEL) {
if (this->getLogLevel()==child->getLogLevel())
return(true);
else
return(false);
}
//Group by Day
else if (groupBy==GROUP_BY_DAY) {
if (getTime().date()==child->getTime().date())
return(true);
else
return(false);
}
//Group by Hour
else if (groupBy==GROUP_BY_HOUR) {
QTime parentTime=getTime().time();
QTime childTime=child->getTime().time();
if (getTime().date()==child->getTime().date() && parentTime.hour()==childTime.hour())
return(true);
else
return(false);
}
//Group by Log File
else if (groupBy==GROUP_BY_LOG_FILE) {
if (getOriginalFile()==child->getOriginalFile())
return(true);
else
return(false);
}
//Group by specific column
else {
int index=ParentLogLine::getGroupedColumnIndex(columns, getGroupByColumn());
QStringList& list=getItemList();
if (index<0 || index>=(int)list.size())
return(false);
else {
if (list[index]==child->getItemList()[index])
return(true);
else
return(false);
}
}
}
int ParentLogLine::getGroupedColumnIndex(LogViewColumns* columns, int column) {
LogViewColumns::Iterator it = columns->begin();
//If there is an error in the parameter
if (column==-1) {
kdDebug() << "Bad Grouped Index " << endl;
return(-1);
}
int i=0;
int found=0;
bool ok=false;
LogViewColumn* logColumn;
while(it!=columns->end()) {
logColumn=*it;
if (logColumn->isFiltred==true) {
if (found==column) {
ok=true;
break;
}
found++;
}
i++;
it++;
}
if (ok==false) {
kdDebug() << "Grouped Column Index Not found" << endl;
return(-1);
}
else {
//We substract 1 because of the Date column (always here!)
return(i-1);
}
}
void ParentLogLine::removeChild(LogLine* child) {
children.remove(child);
}
bool ParentLogLine::hasChildren() {
return(children.count()!=0);
}

@ -0,0 +1,71 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _PARENT_LOG_LINE_H_
#define _PARENT_LOG_LINE_H_
//Qt includes
#include <qobject.h>
//KDE includes
#include <kurl.h>
#include "globals.h"
#include "logLine.h"
#include "logViewColumn.h"
#include "logViewColumns.h"
/**
* @author Nicolas Ternisien
*/
class ParentLogLine : public LogLine {
public:
ParentLogLine(
QDate& date, QTime& time, QStringList& list, QString& originalFile, LogLevel* level, int tpe,
groupByType group, int column, LogViewColumns* cols
);
virtual ~ParentLogLine();
void addChild(LogLine* child);
void removeChild(LogLine* child);
bool isChild(LogLine* child);
bool hasChildren();
groupByType getGroupBy();
int getGroupByColumn();
LogViewColumns* getColumns();
virtual bool isParentLogLine();
static int getGroupedColumnIndex(LogViewColumns* columns, int column);
protected:
QPtrList<LogLine> children;
groupByType groupBy;
int groupByColumn;
LogViewColumns* columns;
};
#endif

@ -0,0 +1,168 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include "parsingHelper.h"
QMap<QString, int> ParsingHelper::mapMonths;
QMap<QString, QString> ParsingHelper::mapHTTPResponse;
QDateTime ParsingHelper::parseDateTimeFromHTTP(QString& logLine) {
//Format example : [22/May/2005:01:50:34 +0200]
QString day=logLine.mid(1,2);
QString month=logLine.mid(4,3);
QString year=logLine.mid(8,4);
QDate date(year.toInt(), ParsingHelper::parseMonthNumber(month), day.toInt());
QString hour=logLine.mid(13,2);
QString min=logLine.mid(16,2);
QString sec=logLine.mid(19,2);
QTime time(hour.toInt(), min.toInt(), sec.toInt());
//QString zone=logLine.mid(22,5);
return(QDateTime(date, time));
}
/**
* Improve speed of this method with a static Map in the class
*/
int ParsingHelper::parseMonthNumber(QString& string) {
//If this is the first time we call this method, we instanciate the map
if (ParsingHelper::mapMonths.isEmpty()) {
ParsingHelper::mapMonths["Jan"]=1;
ParsingHelper::mapMonths["Feb"]=2;
ParsingHelper::mapMonths["Mar"]=3;
ParsingHelper::mapMonths["Apr"]=4;
ParsingHelper::mapMonths["May"]=5;
ParsingHelper::mapMonths["Jun"]=6;
ParsingHelper::mapMonths["Jul"]=7;
ParsingHelper::mapMonths["Aug"]=8;
ParsingHelper::mapMonths["Sep"]=9;
ParsingHelper::mapMonths["Oct"]=10;
ParsingHelper::mapMonths["Nov"]=11;
ParsingHelper::mapMonths["Dec"]=12;
}
QMap<QString, int>::Iterator it;
//Search the month name in the map
it=ParsingHelper::mapMonths.find(string);
if (it!=ParsingHelper::mapMonths.end())
return(*it);
else
return(1);
}
QString ParsingHelper::parseSize(const QString& stringSize) {
long size=stringSize.toLong();
if (size<1024)
return(i18n("Size format", "%1 B").arg(size));
else if (size<1024*1024) {
double newSize=size / 1024.;
QString strNewSize;
strNewSize.sprintf("%0.2f", newSize);
return(i18n("Size format", "%1 KB").arg(strNewSize));
}
else {
double newSize=size / (1024.*1024.);
QString strNewSize;
strNewSize.sprintf("%0.2f", newSize);
return(i18n("Size format", "%1 MB").arg(strNewSize));
}
}
QString ParsingHelper::parseHTTPResponse(const QString& response) {
if (ParsingHelper::mapHTTPResponse.isEmpty()) {
//1xx Responses
mapHTTPResponse["100"]="Continue";
mapHTTPResponse["101"]="Switching Protocols";
//2xx Responses
mapHTTPResponse["200"]="OK";
mapHTTPResponse["201"]="Created";
mapHTTPResponse["202"]="Accepted";
mapHTTPResponse["203"]="Non-Authoritative Information";
mapHTTPResponse["204"]="No Content";
mapHTTPResponse["205"]="Reset Content";
mapHTTPResponse["206"]="Partial Content";
//3xx Responses
mapHTTPResponse["300"]="OK";
mapHTTPResponse["301"]="Moved Permanently";
mapHTTPResponse["302"]="Found";
mapHTTPResponse["303"]="See Other";
mapHTTPResponse["304"]="Not Modified";
mapHTTPResponse["305"]="Use Proxy";
mapHTTPResponse["306"]="(Unused)";
mapHTTPResponse["307"]="Temporary Redirect";
//4xx Responses
mapHTTPResponse["400"]="Bad Request";
mapHTTPResponse["401"]="Unauthorized";
mapHTTPResponse["402"]="Payment Required";
mapHTTPResponse["403"]="Forbidden";
mapHTTPResponse["404"]="Not Found";
mapHTTPResponse["405"]="Method Not Allowed";
mapHTTPResponse["406"]="Not Acceptable";
mapHTTPResponse["407"]="Proxy Authentication Required";
mapHTTPResponse["408"]="Request Timeout";
mapHTTPResponse["409"]="Conflict";
mapHTTPResponse["410"]="Gone";
mapHTTPResponse["411"]="Length Required";
mapHTTPResponse["412"]="Precondition Failed";
mapHTTPResponse["413"]="Request Entity Too Large";
mapHTTPResponse["414"]="Request-URI Too Long";
mapHTTPResponse["415"]="Unsupported Media Type";
mapHTTPResponse["416"]="Requested Range Not Satisfiable";
mapHTTPResponse["417"]="Expectation Failed";
//5xx Responses
mapHTTPResponse["500"]="Internal Server Error";
mapHTTPResponse["501"]="Not Implemented";
mapHTTPResponse["502"]="Bad Gateway";
mapHTTPResponse["503"]="Service Unavailable";
mapHTTPResponse["504"]="Gateway Timeout";
mapHTTPResponse["505"]="HTTP Version Not Supported";
}
//Search the response string in the map
QMap<QString, QString>::Iterator it=ParsingHelper::mapHTTPResponse.find(response);
if (it!=ParsingHelper::mapHTTPResponse.end())
return(QString("%1 %2").arg(response).arg(*it));
else
return(response);
}
QString ParsingHelper::parseAgent(const QString& agent) {
return(agent);
}

@ -0,0 +1,79 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _PARSING_HELPER_H_
#define _PARSING_HELPER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qmap.h>
#include <qpair.h>
#include <kdirwatch.h>
#include <kurl.h>
#include "globals.h"
#include "logListItem.h"
#include "logLine.h"
#include "logManager.h"
#include "logFile.h"
#include "logViewColumn.h"
#include "logViewColumns.h"
/**
* @author Nicolas Ternisien
*/
class ParsingHelper {
public:
/**
* Returns the months number represented by the 3 first letters in the QString parameter
*/
static int parseMonthNumber(QString& month);
static QDateTime parseDateTimeFromHTTP(QString& logLine);
static QString parseSize(const QString& size);
static QString parseHTTPResponse(const QString& response);
static QString parseAgent(const QString& agent);
private:
/**
* Map used by the static parseMonthNumber() method
*/
static QMap<QString, int> mapMonths;
/**
* Map used by the static parseMonthNumber() method
*/
static QMap<QString, QString> mapHTTPResponse;
};
#endif

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_postfix.la
libksystemlog_postfix_la_LDFLAGS = $(all_libraries)
libksystemlog_postfix_la_SOURCES = postfixOptions.cpp
noinst_HEADERS = postfixOptions.h

@ -0,0 +1,100 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "postfixOptions.h"
#include "ksystemlogConfig.h"
PostfixOptions::PostfixOptions(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QString description= i18n("<qt><p>These files will be analyzed to display <b>Postfix Logs</b>. This list also determine the order in which the files are read.</p></qt>");
fileList=new SpecificFileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
PostfixOptions::~PostfixOptions() {
}
bool PostfixOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void PostfixOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void PostfixOptions::saveConfig() {
kdDebug() << "Saving config from Daemon Options..." << endl;
QStringList stringList;
QValueList<int> valueList;
fileList->saveConfig(stringList, valueList);
KSystemLogConfig::setPostfixPaths(stringList);
KSystemLogConfig::setPostfixLevels(valueList);
}
void PostfixOptions::readConfig() {
QStringList stringList=KSystemLogConfig::postfixPaths();
QValueList<int> valueList=KSystemLogConfig::postfixLevels();
fileList->readConfig(stringList, valueList);
}
#include "postfixOptions.moc"

@ -0,0 +1,59 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _POSTFIX_OPTIONS_H_
#define _POSTFIX_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "specificFileList.h"
#include "logLevel.h"
class PostfixOptions : public QWidget {
Q_OBJECT
public:
PostfixOptions(QWidget *parent = 0);
~PostfixOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
SpecificFileList* fileList;
};
#endif

@ -0,0 +1,159 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "reader.h"
#include "view.h"
#include <qpixmap.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kdebug.h>
Reader::Reader(QObject *parent, const char *name) :
QObject(parent, name),
logManager(NULL)
{
watch=new KDirWatch();
kdDebug() << watch->internalMethod() << endl;
connect(watch, SIGNAL(dirty(const QString&)), this, SLOT(logChanged(const QString&)));
}
Reader::~Reader() {
/**
* Remove the watching on the monitored files
*/
LogFiles& files=logManager->getLogFiles();
LogFiles::iterator it;
for(it=files.begin(); it!=files.end(); ++it) {
LogFile* file=*it;
kdDebug() << "Remove the monitoring on file : " << file->url.path() << endl;
watch->removeFile(file->url.path());
}
//Delete the watching object
delete watch;
}
void Reader::setLogManager(LogManager* manager) {
logManager=manager;
}
void Reader::watchLogFiles() {
LogFiles& files=logManager->getLogFiles();
LogFiles::iterator it;
for(it=files.begin(); it!=files.end(); ++it) {
LogFile* file=*it;
watchLogFile(file);
}
}
void Reader::watchLogFile(LogFile* file) {
kdDebug() << "Monitoring file : " << file->url.path() << endl;
watch->addFile(file->url.path());
}
void Reader::logChanged(LogFile* file) {
kdDebug() << "Reader: " << file->url.path() << " has changed !" << endl;
}
void Reader::relaunchLogChanged() {
kdDebug() << "Relaunch log changed" << endl;
LogFiles& files=logManager->getLogFiles();
LogFiles::iterator it;
for(it=files.begin(); it!=files.end(); ++it) {
LogFile* file=*it;
logChanged(file);
}
}
void Reader::logChanged(const QString& name) {
if (!logManager->isParsingPaused()) {
LogFiles& files=logManager->getLogFiles();
LogFiles::iterator it;
for(it=files.begin(); it!=files.end(); ++it) {
LogFile* file=*it;
if (file->url.path() == name) {
logChanged(file);
}
}
}
}
void Reader::closeFile(QFile* file) {
file->close();
delete file;
}
QFile* Reader::openFile(QString name) {
QString message;
KURL testURL(name);
if (testURL.isValid()==false) {
message=i18n("This file is not valid. Please adjust it in the settings of KSystemLog.");
KMessageBox::error(logManager->getView(), message, i18n("The File Does Not Exist"), KMessageBox::Notify);
emit statusbarChanged(message);
return(NULL);
}
QString path=testURL.path();
QFile* file=new QFile(path);
//If the file does not exist
if(! file->exists()) {
message=i18n("The file '%1' does not exist.").arg(name);
KMessageBox::error(logManager->getView(), message, i18n("The File Does Not Exist"), KMessageBox::Notify);
emit statusbarChanged(message);
return(NULL);
}
//If we can open the file
if( !file->open( IO_ReadOnly ) ) {
//It could not be opened
message=i18n("You do not have sufficient permissions to read '%1'.").arg(name);
KMessageBox::error(logManager->getView(), message, i18n("Insufficient Permissions"), KMessageBox::Notify);
emit statusbarChanged(message);
return(NULL);
}
return(file);
}
#include "reader.moc"

@ -0,0 +1,96 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _READER_H_
#define _READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qmap.h>
#include <qpair.h>
#include <kdirwatch.h>
#include <kurl.h>
#include "globals.h"
#include "logListItem.h"
#include "logLine.h"
#include "logManager.h"
#include "logFile.h"
#include "logViewColumn.h"
#include "logViewColumns.h"
class View;
/**
* @author Nicolas Ternisien
*/
class Reader : public QObject {
Q_OBJECT
public:
Reader(QObject* parent=NULL, const char* name=NULL);
~Reader();
virtual void readLog()=0;
virtual void initColumns(LogViewColumns* columns)=0;
virtual void logChanged(LogFile* logFile);
void setLogManager(LogManager* manager);
void watchLogFile(LogFile* file);
void watchLogFiles();
void relaunchLogChanged();
protected:
QFile* openFile(QString name);
void closeFile(QFile* file);
public slots:
void logChanged(const QString&);
signals:
void statusbarChanged(const QString& message);
void logUpdated(int lineTotal);
void openingProgressed(int percent);
void readingBegin();
void readingFile(int currentFile);
void readingEnd();
protected:
LogManager* logManager;
KDirWatch* watch;
};
#endif

@ -0,0 +1,489 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include "ksystemlogConfig.h"
#include "systemReader.h"
#include "xorgReader.h"
#include "cronReader.h"
#include "acpidReader.h"
#include "cupsReader.h"
#include "cupsAccessReader.h"
#include "apacheReader.h"
#include "apacheAccessReader.h"
#include "sambaReader.h"
#include "readerFactory.h"
KURL ReaderFactory::lastOpenedURL;
Reader* ReaderFactory::createReader(LogMode* logMode) {
/**
* Using System Mode in the current view
*/
if (logMode==Globals::systemMode) {
Reader* reader=new SystemReader(NULL, "system_reader");
return(reader);
}
/**
* Using Boot Mode in the current view
*/
else if (logMode==Globals::bootMode) {
Reader* reader=new SystemReader(NULL, "boot_reader");
return(reader);
}
/**
* Using Authentication Mode in the current view
*/
else if (logMode==Globals::authenticationMode) {
Reader* reader=new SystemReader(NULL, "authentication_reader");
return(reader);
}
/**
* Using Kernel Mode in the current view
*/
else if (logMode==Globals::kernelMode) {
Reader* reader=new SystemReader(NULL, "kernel_reader");
return(reader);
}
/**
* Using Daemon Mode in the current view
*/
else if (logMode==Globals::daemonMode) {
Reader* reader=new SystemReader(NULL, "daemon_reader");
return(reader);
}
/**
* Using Cron Mode in the current view
*/
else if (logMode==Globals::cronMode) {
Reader* reader=new CronReader(NULL, "cron_reader");
return(reader);
}
/**
* Using Cron Mode in the current view
*/
else if (logMode==Globals::xorgMode) {
Reader* reader=new XorgReader(NULL, "xorg_reader");
return(reader);
}
/**
* Using ACPID Mode in the current view
*/
else if (logMode==Globals::acpidMode) {
Reader* reader=new AcpidReader(NULL, "acpid_reader");
return(reader);
}
/**
* Using Cups Mode in the current view
*/
else if (logMode==Globals::cupsMode) {
Reader* reader=new CupsReader(NULL, "cups_reader");
return(reader);
}
/**
* Using Cups Access Mode in the current view
*/
else if (logMode==Globals::cupsAccessMode) {
Reader* reader=new CupsAccessReader(NULL, "cups_access_reader");
return(reader);
}
/**
* Using Apache Mode in the current view
*/
else if (logMode==Globals::apacheMode) {
Reader* reader=new ApacheReader(NULL, "apache_reader");
return(reader);
}
/**
* Using Apache Access Mode in the current view
*/
else if (logMode==Globals::apacheAccessMode) {
Reader* reader=new ApacheAccessReader(NULL, "apache_access_reader");
return(reader);
}
/**
* Using Postfix Mode in the current view
*/
else if (logMode==Globals::postfixMode) {
Reader* reader=new SystemReader(NULL, "postfix_reader");
return(reader);
}
/**
* Using Samba Mode in the current view
*/
else if (logMode==Globals::sambaMode) {
Reader* reader=new SambaReader(NULL, "samba_reader");
return(reader);
}
/**
* Using Opening Mode in the current view
*/
else if (logMode==Globals::openingMode) {
//TODO For the moment, SystemReader is always used to parse file.
// Implement a test case for each Reader to know who is the better to read the file
Reader* reader=new SystemReader(NULL, "opening_reader");
return(reader);
}
else {
kdDebug() << "Error : LogMode not found : returns NULL Reader" << endl;
return(NULL);
}
}
LogFiles* ReaderFactory::createLogFiles(LogMode* logMode) {
/**
* Using System Mode in the current view
*/
if (logMode==Globals::systemMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getSystemLogFiles();
return(list);
}
/**
* Using Boot Mode in the current view
*/
else if (logMode==Globals::bootMode) {
//Give the log file list to the reader
LogFile* file=ReaderFactory::getBootLogFile();
LogFiles* list=new LogFiles();
list->append(file);
return(list);
}
/**
* Using Authentication Mode in the current view
*/
else if (logMode==Globals::authenticationMode) {
//Give the log file list to the reader
LogFile* file=ReaderFactory::getAuthenticationLogFile();
LogFiles* list=new LogFiles();
list->append(file);
return(list);
}
/**
* Using Kernel Mode in the current view
*/
else if (logMode==Globals::kernelMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getKernelLogFiles();
return(list);
}
/**
* Using Daemon Mode in the current view
*/
else if (logMode==Globals::daemonMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getDaemonLogFiles();
return(list);
}
/**
* Using Cron Mode in the current view
*/
else if (logMode==Globals::cronMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getCronLogFiles();
return(list);
}
/**
* Using Cron Mode in the current view
*/
else if (logMode==Globals::xorgMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getXorgLogFiles();
return(list);
}
/**
* Using ACPID Mode in the current view
*/
else if (logMode==Globals::acpidMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getAcpidLogFiles();
return(list);
}
/**
* Using Cups Mode in the current view
*/
else if (logMode==Globals::cupsMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getCupsLogFiles();
return(list);
}
/**
* Using Cups Access Mode in the current view
*/
else if (logMode==Globals::cupsAccessMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getCupsAccessLogFiles();
return(list);
}
/**
* Using Apache Mode in the current view
*/
else if (logMode==Globals::apacheMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getApacheLogFiles();
return(list);
}
/**
* Using Apache Access Mode in the current view
*/
else if (logMode==Globals::apacheAccessMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getApacheAccessLogFiles();
return(list);
}
/**
* Using Postfix Mode in the current view
*/
else if (logMode==Globals::postfixMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getPostfixLogFiles();
return(list);
}
/**
* Using Samba Mode in the current view
*/
else if (logMode==Globals::sambaMode) {
//Give the log file list to the reader
LogFiles* list=ReaderFactory::getSambaLogFiles();
return(list);
}
/**
* Using Opening Mode in the current view
*/
else if (logMode==Globals::openingMode) {
//Give the file to open to the reader
//A little hack... ;-) (what an oriented-object solution !)
LogFile* logFile=new LogFile(lastOpenedURL, Globals::informationLogLevel);
LogFiles* list=new LogFiles();
list->append(logFile);
return(list);
}
else {
kdDebug() << "Error : LogFiles not found : returns NULL Reader" << endl;
return(NULL);
}
}
LogFile* ReaderFactory::getGenericLogFile(QString& file) {
LogLevel* level=Globals::informationLogLevel;
KURL url(file);
if (!url.isValid()) {
kdDebug() << i18n("URL '%1' is not valid, skipping this URL.").arg(url.path()) << endl;
return(NULL);
}
LogFile* logFile=new LogFile(url, level);
return(logFile);
}
LogFiles* ReaderFactory::getGenericLogFiles(QStringList& stringList, QValueList<int>& valueList) {
LogFiles* logFiles=new LogFiles();
if (stringList.size() != valueList.size()) {
kdDebug() << i18n("The two arrays size are different, skipping the reading of log files.") << endl;
return(logFiles);
}
LogFile* logFile;
LogLevel* level;
QStringList::Iterator itString=stringList.begin();
QValueList<int>::Iterator itInt=valueList.begin();
while(itString!=stringList.end()) {
if (*itInt>=0 && *itInt<(int) Globals::logLevels.count())
level=Globals::logLevels.at(*itInt);
else
level=Globals::informationLogLevel;
KURL url(*itString);
if (!url.isValid()) {
kdDebug() << i18n("URL '%1' is not valid, skipping this URL.").arg(url.path()) << endl;
continue;
itString++;
itInt++;
}
logFile=new LogFile(url, level);
logFiles->push_back(logFile);
itString++;
itInt++;
}
return(logFiles);
}
LogFiles* ReaderFactory::getNoModeLogFiles(QStringList& stringList) {
LogFiles* logFiles=new LogFiles();
LogFile* logFile;
//Default level used for No Mode logs
LogLevel* level=Globals::noneLogLevel;
QStringList::Iterator it;
for(it=stringList.begin(); it!=stringList.end(); it++) {
KURL url(*it);
if (!url.isValid()) {
kdDebug() << i18n("URL '%1' is not valid, skipping this URL.").arg(url.path()) << endl;
continue;
}
logFile=new LogFile(url, level);
logFiles->push_back(logFile);
}
return(logFiles);
}
LogFile* ReaderFactory::getBootLogFile() {
QString file=KSystemLogConfig::bootPath();
return(getGenericLogFile(file));
}
LogFile* ReaderFactory::getAuthenticationLogFile() {
QString file=KSystemLogConfig::authenticationPath();
return(getGenericLogFile(file));
}
LogFiles* ReaderFactory::getSystemLogFiles() {
QStringList files=KSystemLogConfig::systemPaths();
QValueList<int> levels=KSystemLogConfig::systemLevels();
return(ReaderFactory::getGenericLogFiles(files, levels));
}
LogFiles* ReaderFactory::getAcpidLogFiles() {
QStringList files=KSystemLogConfig::acpidPaths();
return(getNoModeLogFiles(files));
}
LogFiles* ReaderFactory::getKernelLogFiles() {
QStringList files=KSystemLogConfig::kernelPaths();
QValueList<int> levels=KSystemLogConfig::kernelLevels();
return(ReaderFactory::getGenericLogFiles(files, levels));
}
LogFiles* ReaderFactory::getDaemonLogFiles() {
QStringList files=KSystemLogConfig::daemonPaths();
QValueList<int> levels=KSystemLogConfig::daemonLevels();
return(ReaderFactory::getGenericLogFiles(files, levels));
}
LogFiles* ReaderFactory::getCronLogFiles() {
QStringList files=KSystemLogConfig::cronPaths();
QValueList<int> levels=KSystemLogConfig::cronLevels();
return(ReaderFactory::getGenericLogFiles(files, levels));
}
LogFiles* ReaderFactory::getXorgLogFiles() {
QStringList stringList=KSystemLogConfig::xorgPaths();
return(getNoModeLogFiles(stringList));
}
LogFiles* ReaderFactory::getCupsLogFiles() {
QStringList stringList=KSystemLogConfig::cupsPaths();
return(getNoModeLogFiles(stringList));
}
LogFiles* ReaderFactory::getCupsAccessLogFiles() {
QStringList stringList=KSystemLogConfig::cupsAccessPaths();
return(getNoModeLogFiles(stringList));
}
LogFiles* ReaderFactory::getApacheLogFiles() {
QStringList stringList=KSystemLogConfig::apachePaths();
return(getNoModeLogFiles(stringList));
}
LogFiles* ReaderFactory::getApacheAccessLogFiles() {
QStringList stringList=KSystemLogConfig::apacheAccessPaths();
return(getNoModeLogFiles(stringList));
}
LogFiles* ReaderFactory::getPostfixLogFiles() {
QStringList files=KSystemLogConfig::postfixPaths();
QValueList<int> levels=KSystemLogConfig::postfixLevels();
return(ReaderFactory::getGenericLogFiles(files, levels));
}
LogFiles* ReaderFactory::getSambaLogFiles() {
QStringList stringList=KSystemLogConfig::sambaPaths();
return(getNoModeLogFiles(stringList));
}

@ -0,0 +1,127 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _READER_FACTORY_H_
#define _READER_FACTORY_H_
#include <qobject.h>
#include "globals.h"
#include "reader.h"
#include "logMode.h"
#include "logFile.h"
#include "logLevel.h"
#include <kurl.h>
/**
* @author Nicolas Ternisien
*/
class ReaderFactory {
public:
static Reader* createReader(LogMode* logMode);
static LogFiles* createLogFiles(LogMode* logMode);
//TODO Change this *BIG* hack to a well oriented object form
static KURL lastOpenedURL;
private:
static LogFiles* getNoModeLogFiles(QStringList& stringList);
static LogFiles* getGenericLogFiles(QStringList& stringList, QValueList<int>& valueList);
static LogFile* getGenericLogFile(QString& file);
/**
* Get System log files from configuration
*/
static LogFiles* getSystemLogFiles();
/**
* Get X.org path from configuration
*/
static LogFiles* getXorgLogFiles();
/**
* Get Kernel log files from configuration
*/
static LogFiles* getKernelLogFiles();
/**
* Get Daemon log files from configuration
*/
static LogFiles* getDaemonLogFiles();
/**
* Get Cron log files from configuration
*/
static LogFiles* getCronLogFiles();
/**
* Get ACPID log files from configuration
*/
static LogFiles* getAcpidLogFiles();
/**
* Get Cups log files from configuration
*/
static LogFiles* getCupsLogFiles();
/**
* Get Cups Access log files from configuration
*/
static LogFiles* getCupsAccessLogFiles();
/**
* Get Apache log files from configuration
*/
static LogFiles* getApacheLogFiles();
/**
* Get Apache Access log files from configuration
*/
static LogFiles* getApacheAccessLogFiles();
/**
* Get Postfix log files from configuration
*/
static LogFiles* getPostfixLogFiles();
/**
* Get Bool log file from configuration
*/
static LogFile* getBootLogFile();
/**
* Get Authentication log file from configuration
*/
static LogFile* getAuthenticationLogFile();
/**
* Get Samba path from configuration
*/
static LogFiles* getSambaLogFiles();
};
#endif

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_samba.la
libksystemlog_samba_la_LDFLAGS = $(all_libraries)
libksystemlog_samba_la_SOURCES = sambaOptions.cpp sambaReader.cpp
noinst_HEADERS = sambaReader.h sambaOptions.h

@ -0,0 +1,104 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "sambaOptions.h"
#include "ksystemlogConfig.h"
SambaOptions::SambaOptions(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QString description= i18n("<qt><p>These files will be analyzed to display <b>Samba log</b>. This list also determines the order in which the files are read.</p></qt>");
fileList=new FileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
SambaOptions::~SambaOptions() {
}
bool SambaOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void SambaOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void SambaOptions::saveConfig() {
kdDebug() << "Save config from SambaOptions" << endl;
QStringList list;
int count=fileList->count();
for (int i=0; i<count; i++) {
list.push_back(fileList->getText(i));
}
KSystemLogConfig::setSambaPaths(list);
}
void SambaOptions::readConfig() {
QStringList files(KSystemLogConfig::sambaPaths());
QStringList::iterator it;
for(it=files.begin(); it!=files.end(); ++it) {
fileList->insertItem(*it);
}
}
#include "sambaOptions.moc"

@ -0,0 +1,61 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _SAMBA_OPTIONS_H_
#define _SAMBA_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "fileList.h"
#include "logLevel.h"
class SambaOptions : public QWidget {
Q_OBJECT
public:
SambaOptions(QWidget *parent = 0);
~SambaOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
FileList* fileList;
};
#endif

@ -0,0 +1,169 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
#include <kmessagebox.h>
#include "parsingHelper.h"
#include "sambaReader.h"
SambaReader::SambaReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
}
SambaReader::~SambaReader() {
}
void SambaReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Source File"), true, true));
columns->append(new LogViewColumn(i18n("Function"), true, true));
columns->append(new LogViewColumn(i18n("Line"), true, true));
columns->append(new LogViewColumn(i18n("Message"), true, false));
}
LogLine* SambaReader::parseMessage(QString& logLine, LogFile* logFile) {
/*
* Log line examples :
* [2005/06/27 21:06:01, 0] nmbd/nmbd.c:main(668)
* Netbios nameserver version 3.0.14a started.
* Copyright Andrew Tridgell and the Samba Team 1994-2004
* [2005/06/27 21:11:46, 0] nmbd/nmbd_become_lmb.c:become_local_master_stage2(396)
* *****
* Samba name server STEAKHACHE is now a local master browser for workgroup MAISON on subnet 192.168.1.33
*
* *****
* [2005/06/28 06:41:03, 0] nmbd/nmbd.c:terminate(56)
* Got SIGTERM: going down...
* [2005/06/28 18:08:11, 0] nmbd/nmbd.c:main(668)
* Netbios nameserver version 3.0.14a started.
* Copyright Andrew Tridgell and the Samba Team 1994-2004
*/
//The Date
int dateBegin=logLine.find("[");
int dateEnd=logLine.find("]");
QString strDate=logLine.mid(dateBegin+1, dateEnd-dateBegin-1);
QString year=strDate.mid(0, 4);
QString month=strDate.mid(5, 2);
QString day=strDate.mid(8, 2);
QString hour=strDate.mid(11, 2);
QString min=strDate.mid(14, 2);
QString sec=strDate.mid(17, 2);
QDate date=QDate(year.toInt(), month.toInt(), day.toInt());
QTime time=QTime(hour.toInt(), min.toInt(), sec.toInt());
logLine=logLine.remove(0, dateEnd+2);
//The source file
int doubleDot;
doubleDot=logLine.find(":");
QString file=logLine.left(doubleDot);
logLine=logLine.remove(0, doubleDot+1);
//The function
int bracket=logLine.find("(");
QString function=logLine.left(bracket);
logLine=logLine.remove(0, bracket+1);
//The line number
bracket=logLine.find(")");
QString lineNumber=logLine.left(bracket);
//Remove the first return character and the two useless space of the first message line
logLine=logLine.remove(0, bracket+4);
//Message
//Remove the last \n
logLine=logLine.left(logLine.length()-1);
//Remove return characters and 2 first spaces at each lines
QString message=logLine.replace("\n ", " / ");
//QString message=logLine.replace("\n", " / ");
QStringList list;
list.push_back(file);
list.push_back(function);
list.push_back(lineNumber);
list.push_back(message);
QString filePath=logFile->url.path();
LogLine* line=new LogLine(date, time, list, filePath, Globals::informationLogLevel, Globals::sambaMode->id);
return(line);
}
QStringList* SambaReader::getRawBuffer(QFile* file) {
kdDebug() << "Retrieving the raw buffer..." << endl;
QString line;
QString buffer;
QString tmpBuffer;
QStringList* rawBuffer=new QStringList();
int res;
//Insert the content of the file in a string list
while(!file->atEnd()) {
//Read the first MaxCharactersRead characters
res=file->readLine(buffer, tmpMaxCharacters);
//Ignore the rest of the line
while(res==tmpMaxCharacters)
file->readLine(tmpBuffer, tmpMaxCharacters);
if (buffer[0]=='[') {
//If it is not the first time we add a line
if (!line.isNull()) {
//Push the new buffer to the list
rawBuffer->push_back(line);
}
line=buffer;
}
else {
//line+='\n';
line+=buffer;
}
}
kdDebug() << "Raw buffer retrieved." << endl;
return(rawBuffer);
}
#include "sambaReader.moc"

@ -0,0 +1,56 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _SAMBA_READER_H_
#define _SAMBA_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class SambaReader : public DefaultReader {
Q_OBJECT
public:
SambaReader(QObject *parent = 0, const char *name = 0);
virtual ~SambaReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
virtual QStringList* getRawBuffer(QFile* file);
};
#endif

@ -0,0 +1,60 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <klocale.h>
//For compatibility with old versions of KDE
#include <kdeversion.h>
#include "ksystemlog.h"
//Include the right header, depending of the version of KDE
#if defined(KDE_MAKE_VERSION) && (KDE_VERSION >= KDE_MAKE_VERSION(3,4,0))
#include "slotLogAction.h"
#else
#include "slotLogActionCompatibility.h"
#endif
SlotLogAction::SlotLogAction(KSystemLog* p) :
parent(p) {
}
#if defined(KDE_MAKE_VERSION) && (KDE_VERSION >= KDE_MAKE_VERSION(3,4,0))
void SlotLogAction::slotLogAction(KAction::ActivationReason reason, Qt::ButtonState state) {
const QObject* sender=QObject::sender();
//We can call the correct method from KSystemLog, which manage the two parameters
parent->logActionClicked(sender, reason, state);
}
#else
void SlotLogAction::slotLogAction() {
const QObject* sender=QObject::sender();
//In the other case, We can only call the method from KSystemLog, which keeps compatibility
parent->logActionClicked(sender);
}
#endif
//Include the right MOC file, depending of the version of KDE
#if defined(KDE_MAKE_VERSION) && (KDE_VERSION >= KDE_MAKE_VERSION(3,4,0))
#include "slotLogAction.moc"
#else
#include "slotLogActionCompatibility.moc"
#endif

@ -0,0 +1,48 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _SLOT_LOG_ACTION_H_
#define _SLOT_LOG_ACTION_H_
#include <kaction.h>
class KSystemLog;
class SlotLogAction : public QObject {
Q_OBJECT
public:
SlotLogAction(KSystemLog* parent);
public slots:
/**
* This header contains the normal version of the main slot
*/
void slotLogAction(KAction::ActivationReason reason, Qt::ButtonState state);
private:
KSystemLog* parent;
};
#endif

@ -0,0 +1,48 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _SLOT_LOG_ACTION_H_
#define _SLOT_LOG_ACTION_H_
#include <kaction.h>
class KSystemLog;
class SlotLogAction : public QObject {
Q_OBJECT
public:
SlotLogAction(KSystemLog* parent);
public slots:
/**
* This header contains a special version of the main slot :
* without parameters to keep compatibility with old KDE versions
*/
void slotLogAction();
private:
KSystemLog* parent;
};
#endif

@ -0,0 +1,211 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <qlayout.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qtooltip.h>
#include <qlabel.h>
#include <qwhatsthis.h>
// KDE includes
#include <klocale.h>
#include <kfiledialog.h>
#include <kdialogbase.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
#include "globals.h"
#include "specificFileList.h"
SpecificFileList::SpecificFileList(QWidget* parent, QString description) :
FileList(parent, description)
{
changeItem=new QPushButton(SmallIconSet("colorize"), i18n("&Change Status..."), buttons);
connect(changeItem, SIGNAL(clicked()), this, SLOT(changeItemType()));
QToolTip::add(changeItem, i18n("Change the level of the current file(s)"));
QWhatsThis::add(changeItem, i18n("<qt>Changes the level of the current file(s). See KSystemLog documentation for more information about each log level.</qt>"));
fileListMenu->insertSeparator();
fileListMenu->insertItem(SmallIcon("colorize"), i18n("&Change Status"), this, SLOT(changeItemType()));
changeItem->setEnabled(false);
}
SpecificFileList::~SpecificFileList() {
}
void SpecificFileList::insertItem(QString& item) {
this->insertItem(Globals::informationLogLevel, item);
}
void SpecificFileList::insertItem(LogLevel* level, QString& item) {
fileList->insertItem(level->pixmap, item);
levels[fileList->item(fileList->count()-1)]=level->id;
}
void SpecificFileList::removeItem(int id) {
levels.erase(fileList->item(id));
fileList->removeItem(id);
}
void SpecificFileList::addItem() {
//Open a standard Filedialog
KURL::List urlList;
urlList=KFileDialog::getOpenURLs(DEFAULT_FOLDER, "*|" + i18n("All Files (*)") + "\n*.log|" + i18n("Log Files (*.log)"), this, i18n("Choose Log File"));
KURL url;
KURL::List::iterator it;
for(it=urlList.begin(); it!=urlList.end(); ++it) {
url=*it;
if (isValidFile(url)) {
QString path=url.path();
this->insertItem(Globals::informationLogLevel, path);
}
}
emit fileListChanged(fileList->count());
}
bool SpecificFileList::updateButtons() {
bool value=FileList::updateButtons();
//If nothing is selected, disabled special buttons
changeItem->setEnabled(value);
return(value);
}
void SpecificFileList::changeItemType() {
kdDebug() << "Change Item type" << endl;
KDialogBase dialog(this, "select_type", true, i18n("Selecting File Type"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok);
QVBox topContents(&dialog);
topContents.setSpacing(8);
topContents.setMinimumSize(QSize(100, 230));
QLabel text(i18n("Please select the type of this file:"), &topContents);
KListBox choiceList(&topContents, "type_list");
QToolTip::add(choiceList.viewport(), i18n("List of existing log levels"));
QWhatsThis::add(choiceList.viewport(), i18n("<qt>This is the list of all existing log levels. Please select one of them to be used for the selected files of the list.</qt>"));
//TODO Move this code to a specific class
//connect(&choiceList, SIGNAL(doubleClicked(QListBoxItem*)), &dialog, SLOT(okClicked()));
QPtrListIterator<LogLevel> itLevel(Globals::logLevels);
LogLevel* level=itLevel.current();
while (level!=NULL) {
choiceList.insertItem(level->pixmap, level->name);
++itLevel;
level=itLevel.current();
}
text.setBuddy(&choiceList);
dialog.setMainWidget(&topContents);
dialog.enableButtonSeparator(false);
int choice=dialog.exec();
if (choice==QDialog::Accepted) {
int count=fileList->count();
int selected=-1;
if (choiceList.selectedItem()!=NULL)
selected=choiceList.index(choiceList.selectedItem());
if (selected!=-1) {
for (int i=0; i<count; i++) {
if (fileList->isSelected(i)) {
levels.erase(fileList->item(i));
fileList->changeItem(*(choiceList.pixmap(selected)), fileList->text(i), i);
levels[fileList->item(i)]=selected;
}
}
emit fileListChanged(fileList->numRows());
}
}
}
LogLevel* SpecificFileList::getLevel(int i) {
return(Globals::logLevels.at(levels[fileList->item(i)]));
}
void SpecificFileList::saveConfig(QStringList& filePathList, QValueList<int>& logLevelList) {
int count=fileList->count();
for (int i=0; i<count; i++) {
logLevelList.push_back(this->getLevel(i)->id);
filePathList.push_back(this->getText(i));
}
}
void SpecificFileList::readConfig(QStringList& stringList, QValueList<int>& valueList) {
//A little security test
if (stringList.size() != valueList.size()) {
kdDebug() << i18n("The two arrays size are different, skipping the reading of generic paths.") << endl;
return;
}
LogLevel* level;
QStringList::Iterator itString=stringList.begin();
QValueList<int>::Iterator itInt=valueList.begin();
while(itString!=stringList.end()) {
if (*itInt>=0 && *itInt<(int) Globals::logLevels.count())
level=Globals::logLevels.at(*itInt);
else
level=Globals::informationLogLevel;
//TODO Is it VERY useful to test if *itString is a real URL or not ?
//if (!KURL(*itString).isValid())
this->insertItem(level, *itString);
itString++;
itInt++;
}
}
#include "specificFileList.moc"

@ -0,0 +1,66 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _SPECIFIC_FILE_LIST_H_
#define _SPECIFIC_FILE_LIST_H_
#include <qstringlist.h>
#include <qstring.h>
#include "globals.h"
#include "fileList.h"
class SpecificFileList : public FileList {
Q_OBJECT
public:
SpecificFileList(QWidget *parent, QString description);
~SpecificFileList();
virtual void insertItem(QString& item);
void insertItem(LogLevel* level, QString& item);
virtual void removeItem(int id);
LogLevel* getLevel(int i);
void saveConfig(QStringList& filePaths, QValueList<int>& fileLevels);
void readConfig(QStringList& filePaths, QValueList<int>& fileLevels);
protected:
virtual bool updateButtons();
virtual void addItem();
private slots:
void changeItemType();
private:
QPushButton* changeItem;
QMap<QListBoxItem*, int> levels;
};
#endif //_SPECIFIC_FILE_LIST_H_

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_system.la
libksystemlog_system_la_LDFLAGS = $(all_libraries)
libksystemlog_system_la_SOURCES = systemOptions.cpp systemReader.cpp
noinst_HEADERS = systemOptions.h systemReader.h

@ -0,0 +1,102 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "systemOptions.h"
#include "ksystemlogConfig.h"
SystemOptions::SystemOptions(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout* layout = new QVBoxLayout(this);
//layout->setAutoAdd(true);
QString description= i18n("<qt><p>These files will be analyzed to display <b>System logs</b>. This list also determines the order in which the files are read.</p></qt>");
fileList=new SpecificFileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
layout->addWidget(fileList);
readConfig();
}
SystemOptions::~SystemOptions() {
}
bool SystemOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void SystemOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void SystemOptions::saveConfig() {
kdDebug() << "Saving config from System Options..." << endl;
QStringList stringList;
QValueList<int> valueList;
fileList->saveConfig(stringList, valueList);
KSystemLogConfig::setSystemPaths(stringList);
KSystemLogConfig::setSystemLevels(valueList);
}
void SystemOptions::readConfig() {
QStringList stringList=KSystemLogConfig::systemPaths();
QValueList<int> valueList=KSystemLogConfig::systemLevels();
fileList->readConfig(stringList, valueList);
}
#include "systemOptions.moc"

@ -0,0 +1,63 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _SYSTEM_OPTIONS_H_
#define _SYSTEM_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <qcheckbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "specificFileList.h"
#include "logLevel.h"
class SystemOptions : public QWidget {
Q_OBJECT
public:
SystemOptions(QWidget *parent = 0);
~SystemOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
SpecificFileList* fileList;
};
#endif

@ -0,0 +1,51 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "systemReader.h"
#include <klocale.h>
#include <kmessagebox.h>
SystemReader::SystemReader(QObject *parent, const char *name) :
DefaultReader(parent, name)
{
}
SystemReader::~SystemReader() {
}
void SystemReader::initColumns(LogViewColumns* columns) {
columns->append(new LogViewColumn(i18n("Date"), true, false));
columns->append(new LogViewColumn(i18n("Host Name"), true, true));
columns->append(new LogViewColumn(i18n("Process"), true, true));
columns->append(new LogViewColumn(i18n("Message"), true, false));
}
LogLine* SystemReader::parseMessage(QString& logLine, LogFile* logFile) {
//For the moment this method is correct
return(DefaultReader::parseMessage(logLine, logFile));
}
#include "systemReader.moc"

@ -0,0 +1,53 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _SYSTEM_READER_H_
#define _SYSTEM_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <kurl.h>
#include <qfile.h>
#include "view.h"
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class SystemReader : public DefaultReader {
Q_OBJECT
public:
SystemReader(QObject *parent = 0, const char *name = 0);
virtual ~SystemReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& logLine, LogFile* logFile);
};
#endif

@ -0,0 +1,456 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qpainter.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qlabel.h>
#include <qstring.h>
#include <qwhatsthis.h>
#include <qtooltip.h>
#include <qlistview.h>
#include <qpixmap.h>
//KDE includes
#include <kurl.h>
#include <ktrader.h>
#include <klibloader.h>
#include <kmessagebox.h>
#include <krun.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kdebug.h>
//For compatibility with old versions of KDE
#include <kdeversion.h>
//Project includes
#include "view.h"
#include "logListItem.h"
#include "logLine.h"
#include "viewToolTip.h"
#include "ksystemlogConfig.h"
#include "ksystemlog.h"
View::View(QWidget *parent) :
DCOPObject("KSystemLogInterface"),
QWidget(parent),
logManager(NULL),
table(NULL),
columns(NULL),
firstLoad(true)
{
// setup our layout manager to automatically add our widgets
QVBoxLayout* topLayout = new QVBoxLayout(this);
topLayout->setAutoAdd(true);
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
filterBar=new QHBox(this);
filterBar->setSpacing(5);
filterBar->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );
clearSearch=new KToolBarButton( QApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, filterBar);
clearSearch->setText(i18n("Clear the filter"));
QWhatsThis::add(clearSearch, i18n("This button clears the filter in one click."));
QToolTip::add(clearSearch, i18n("Clear the filter"));
QLabel* label=new QLabel(i18n("Filter:"), filterBar);
search=new LogLineFilter(filterBar, (KListView*)NULL);
label->setBuddy(search);
QWhatsThis::add(search, i18n("Allows you to select only list items that match the content of this text."));
QToolTip::add(search, i18n("Type your item filter here"));
label=new QLabel(i18n("Column:"), filterBar);
this->initSearchFilter(filterBar);
label->setBuddy(searchFilter);
toggleFilterBar();
#endif
this->initLogList();
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
//We initialize the table after, after the initialization of the table
search->setListView(table);
//Connect the pressed signal of the clear button to the clear slot of "clear"
connect(clearSearch, SIGNAL(pressed()), search, SLOT(clear()));
#endif
}
View::~View() {
#if defined(KDE_MAKE_VERSION) && (KDE_VERSION >= KDE_MAKE_VERSION(3,3,0))
delete clearSearch;
delete search;
delete searchFilter;
delete filterBar;
#endif
kdDebug() << "Destroying View" << endl;
}
void View::saveConfig() {
kdDebug() << "Saving View Layout..." << endl;
KSystemLogConfig* configXT=KSystemLogConfig::self();
KConfig* config=configXT->config();
QString group="List";
group.append(logManager->getIndex());
table->saveLayout(config, group);
}
void View::setLogManager(LogManager* manager) {
logManager=manager;
}
//TODO Deprecate this method as soon as possible
void View::openURL(QString url) {
kdDebug() << "DCOP Interface : " << url << endl;
}
bool View::isTooltipEnabled() {
return(logManager->isTooltipEnabled());
}
void View::toggleFilterBar() {
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
//The newly created bar is only displayed if the config file allow it
if (KSystemLogConfig::toggleFilterBar()==true)
filterBar->show();
else
filterBar->hide();
#endif
}
/**
* Delete the "count" first items
*/
void View::deleteOldItems(int count) {
QListViewItem* item;
for(int i=0; i<count; i++) {
item=table->lastItem();
table->takeItem(item);
}
}
int View::getItemCount() {
int count=0;
if (logManager->getGroupBy()==NO_GROUP_BY) {
count=table->childCount();
}
else {
QPtrList<QListViewItem> lst;
QListViewItemIterator it(table);
while (it.current()!=NULL) {
count+=it.current()->childCount();
++it;
}
}
return(count);
}
void View::setColumns(LogViewColumns* list) {
kdDebug() << "Change columns" << endl;
columns=list;
updateList();
//TODO Maybe with the deleting of the config group, this boolean is useless
if (firstLoad==true) {
KSystemLogConfig* configXT=KSystemLogConfig::self();
QString group="List";
group.append(logManager->getIndex());
//We first restore the layout from the config
table->restoreLayout(configXT->config(), group);
//Then we delete it from config, to avoid reloading problem
configXT->config()->deleteGroup(group);
firstLoad=false;
}
updateSearchFilter();
}
void View::setFirstItemVisible() {
table->ensureItemVisible(table->firstChild());
}
void View::setLastItemVisible() {
table->ensureItemVisible(table->lastItem());
}
void View::setFirstItemSelected() {
table->setCurrentItem(table->firstChild());
table->setSelected(table->firstChild(), true);
table->ensureItemVisible(table->firstChild());
}
void View::setLastItemSelected() {
table->setCurrentItem(table->lastItem());
table->setSelected(table->lastItem(), true);
table->ensureItemVisible(table->lastItem());
}
void View::updateSearchFilter() {
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
//We first delete all items
int count=searchFilter->count() - 1;
while (count>=0) {
searchFilter->removeItem(count);
count--;
}
//Then we insert the default items
searchFilter->insertItem(i18n("All"));
LogViewColumns::Iterator it = columns->begin();
LogViewColumn* column;
while(it!=columns->end()) {
column=*it;
if (column->isFiltred==true)
searchFilter->insertItem(column->columnName);
it++;
}
searchFilter->setCurrentItem(0);
#endif
}
void View::updateList() {
//First, delete all current columns
int count=table->columns() - 1;
while (count>=0) {
table->removeColumn(count);
count--;
}
LogViewColumns::Iterator it = columns->begin();
LogViewColumn* column;
//Add all columns of the columns list object
while(it!=columns->end()) {
column=*it;
table->addColumn(column->columnName, -1);
it++;
}
//Adjust them to the size of the current maximum item
int i=0;
while (i<table->columns()) {
table->adjustColumn(i);
i++;
}
//TODO Try to reduce size of first column with a
}
void View::initLogList() {
table=new KListView(this, "log_list");
QWhatsThis::add(table, i18n("<qt><p>This is the main view of KSystemLog. It displays the last lines of the selected log. Please see the documentation to discovers the meaning of each icons and existing log.</p><p>Log lines in <b>bold</b> are the last added to the list.</p></qt>"));
table->addColumn("Message");
table->setSorting(0, true);
//table->setRootIsDecorated(true);
table->setShowSortIndicator(true);
table->setAllColumnsShowFocus(true);
//This method is not implemented for the moment by KListView class
table->setAutoOpen(false);
//This is buggy but it's not my fault (I hope :-)
table->setFullWidth(true);
//TODO Find a color from QColorGroup
QColor* alternate=new QColor(246,246,255);
table->setAlternateBackground(*alternate);
table->setSelectionModeExt(KListView::Extended);
toolTip=new ViewToolTip(this->getLogList()->viewport(), this);
}
LogListItem* View::getFirstSelectedItem() {
QListViewItemIterator it(table, QListViewItemIterator::Selected);
//Returns the first selected item or NULL is there is no item selected
return(static_cast<LogListItem*> (it.current()));
}
LogListItem* View::getLastSelectedItem() {
QListViewItemIterator it(table, QListViewItemIterator::Selected);
QListViewItem* item=NULL;
while (it.current()) {
item=it.current();
it++;
}
//Returns the last selected item or NULL is there is no item selected
return(static_cast<LogListItem*> (item));
}
void View::setSortEnabled(bool enabled) {
if (enabled==true)
table->setSorting(table->columns()+1);
else
table->setSorting(-1);
}
void View::initSearchFilter(QWidget* filterBox) {
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
searchFilter=new QComboBox(filterBox);
QWhatsThis::add(searchFilter, i18n("<qt>Allows you to apply the item filter only on the specified column here. \"<i>All</i>\" column means no specific filter.</qt>"));
QToolTip::add(searchFilter, i18n("Choose the filtered column here"));
searchFilter->insertItem(i18n("All"));
//TODO 0 is not a very good value... Improve that. and of course, try to find a better solution
searchFilter->setMinimumSize(70, 0);
connect(searchFilter, SIGNAL(activated(int)), search, SLOT(setFocus()));
connect(searchFilter, SIGNAL(activated(int)), this, SLOT(changeColumnFilter(int)));
connect(searchFilter, SIGNAL(activated(int)), search, SLOT(updateSearch()));
#endif
}
void View::addElement(QStringList* entries, QPixmap* icon) {
QStringList::Iterator it = entries->begin();
KListViewItem* item=new KListViewItem(table, *(it++), *(it++), *(it++), *(it++), *(it++));
if (icon!=NULL)
item->setPixmap(0, *icon);
}
void View::addElementAtEnd(QStringList* entries, QPixmap* icon) {
QStringList::Iterator it = entries->begin();
KListViewItem* item=new KListViewItem(table, table->lastItem(), *(it++), *(it++), *(it++), *(it++), *(it++));
if (icon!=NULL)
item->setPixmap(0, *icon);
}
KListView* View::getLogList() {
return(table);
}
void View::changeColumnFilter(int column) {
#if defined(KDE_MAKE_VERSION) && KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
QValueList<int> filterColumns;
//The user select all columns
if (column==0) {
search->setSearchColumns(filterColumns);
}
else {
QString columnName=searchFilter->currentText();
LogViewColumns::Iterator it;
LogViewColumn* column;
int position=0;
for(it=columns->begin(); it!=columns->end(); it++) {
column=*it;
if (column->columnName==columnName)
break;
position++;
}
filterColumns.append(position);
search->setSearchColumns(filterColumns);
}
//search->updateSearch();
#endif
}
void View::print(QPainter* /*p*/, int /*height*/, int /*width*/) {
//Print log files here
}
void View::slotOnURL(const QString& url) {
emit changeStatusbar(url);
}
void View::slotSetTitle(const QString& title) {
emit changeCaption(title);
}
void View::clearLogList( ) {
table->clear();
}
#include "view.moc"

@ -0,0 +1,189 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef VIEW_H
#define VIEW_H
//Qt includes
#include <qwidget.h>
#include <qdatetime.h>
//KDE includes
#include <ktoolbarbutton.h>
#include <kicondialog.h>
#include <klistview.h>
//For compatibility with old versions of KDE
#include <kdeversion.h>
//The filter is activated only if KDE version >= 3.3
#if defined(KDE_MAKE_VERSION) && (KDE_VERSION >= KDE_MAKE_VERSION(3,3,0))
#include "logLineFilter.h"
#endif
#include <kconfig.h>
#include <ksystemlogiface.h>
#include <kparts/part.h>
#include "globals.h"
#include "logListItem.h"
#include "logManager.h"
#include "logViewColumn.h"
#include "logViewColumns.h"
class ViewToolTip;
/**
* This is the main view class for KSystemLog.
* This class is encapsulated in a LogManager, with a Reader (in a standard LogManager)
*
*
* @short Main view
* @author Nicolas Ternisien <nicolas.ternisien@gmail.com>
* @version 0.1
*/
class View : public QWidget, public KSystemLogInterface {
Q_OBJECT
public:
/**
* Default constructor
*/
View(QWidget *parent);
/**
* Destructor
*/
virtual ~View();
void clearLogList();
void addElement(QStringList* entries, QPixmap* icon=NULL);
void addElementAtEnd(QStringList* entries, QPixmap* icon=NULL);
void setColumns(LogViewColumns* list);
void setFirstItemSelected();
void setLastItemSelected();
void setLastItemVisible();
void setFirstItemVisible();
void toggleFilterBar();
LogListItem* getFirstSelectedItem();
LogListItem* getLastSelectedItem();
int getItemCount();
void setSortEnabled(bool enabled);
void setLogManager(LogManager* manager);
bool isTooltipEnabled();
KListView* getLogList();
void saveConfig();
/**
* Delete the "count" first items
*/
void deleteOldItems(int count);
/**
* Print this view to any medium -- paper or not
*/
void print(QPainter *, int height, int width);
/**
* Method from DCOP Interface
*/
virtual void openURL(QString url);
private:
void initLogList();
void initSearchFilter(QWidget* filterBox);
signals:
/**
* Use this signal to change the content of the statusbar
*/
void changeStatusbar(const QString& text);
/**
* Use this signal to change the content of the caption
*/
void changeCaption(const QString& text);
private slots:
void slotOnURL(const QString& url);
void slotSetTitle(const QString& title);
void changeColumnFilter(int column);
void updateList();
void updateSearchFilter();
private:
LogViewColumns* columns;
ViewToolTip* toolTip;
bool firstLoad;
LogManager* logManager;
/**
* Central table
*/
KListView* table;
#if defined(KDE_MAKE_VERSION) && (KDE_VERSION >= KDE_MAKE_VERSION(3,3,0))
QHBox* filterBar;
KToolBarButton* clearSearch;
/**
* Search line (inherits from KListViewSearchLine)
*/
LogLineFilter* search;
/**
* Filter of the column list
*/
QComboBox* searchFilter;
#endif
};
#endif // VIEW_H

@ -0,0 +1,61 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <kdebug.h>
#include <qtooltip.h>
#include <klistview.h>
#include "logListItem.h"
#include "viewToolTip.h"
#include "view.h"
ViewToolTip::ViewToolTip(QWidget *parent, View *view) :
QToolTip(parent),
view(view) {
}
ViewToolTip::~ViewToolTip() {
clear();
}
void ViewToolTip::maybeTip(const QPoint& p) {
//ViewToolTip::setWakeUpDelay(1000);
if (!view->isTooltipEnabled() )
return;
QListViewItem *qtItem = view->getLogList()->itemAt(p);
if (qtItem && qtItem->childCount() == 0) {
LogListItem* item = static_cast<LogListItem*> (qtItem);
QString s=item->getToolTipText();
QRect r= view->getLogList()->itemRect(item);
//kdDebug() << "Left=" << r.left() << " Right=" << r.right() << " Top=" << r.top() << " Bottom=" << r.bottom() << endl;
tip(r, s);
}
}

@ -0,0 +1,44 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _VIEW_TOOL_TIP_H_
#define _VIEW_TOOL_TIP_H_
//#include <qtooltip.h>
class QToolTip;
class View;
//Code taken from KLogTool project
class ViewToolTip : public QToolTip {
public:
ViewToolTip(QWidget *parent, View* view);
virtual ~ViewToolTip();
protected:
void maybeTip( const QPoint& );
private:
View *view;
};
#endif //_VIEW_TOOL_TIP_H_

@ -0,0 +1,7 @@
INCLUDES = -I$(top_srcdir)/ksystemlog/src -I$(top_builddir)/ksystemlog/src/config $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libksystemlog_xorg.la
libksystemlog_xorg_la_LDFLAGS = $(all_libraries)
libksystemlog_xorg_la_SOURCES = xorgOptions.cpp xorgReader.cpp
noinst_HEADERS = xorgOptions.h xorgReader.h

@ -0,0 +1,104 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
//Qt includes
#include <qlayout.h>
#include <qvgroupbox.h>
#include <qbuttongroup.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qhbox.h>
//KDE includes
#include <klocale.h>
#include <kactioncollection.h>
#include <kbuttonbox.h>
#include <klistbox.h>
#include <kfiledialog.h>
#include <kurl.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kdebug.h>
//Project includes
#include "xorgOptions.h"
#include "ksystemlogConfig.h"
XorgOptions::XorgOptions(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setAutoAdd(true);
QString description= i18n("<qt><p>These files will be analyzed to display <b>X.org log</b>. This list also determines the order in which the files are read.</p></qt>");
fileList=new FileList(this, description);
connect(fileList, SIGNAL(fileListChanged(int)), this, SLOT(slotFileListChanged(int)));
readConfig();
}
XorgOptions::~XorgOptions() {
}
bool XorgOptions::isValid() {
if (fileList->count()>0)
return(true);
else
return(false);
}
void XorgOptions::slotFileListChanged(int itemLeft) {
if (itemLeft==0)
emit optionsChanged(false);
else
emit optionsChanged(true);
}
void XorgOptions::saveConfig() {
kdDebug() << "Save config from XorgOptions" << endl;
QStringList list;
int count=fileList->count();
for (int i=0; i<count; i++) {
list.push_back(fileList->getText(i));
}
KSystemLogConfig::setXorgPaths(list);
}
void XorgOptions::readConfig() {
QStringList files(KSystemLogConfig::xorgPaths());
QStringList::iterator it;
for(it=files.begin(); it!=files.end(); ++it) {
fileList->insertItem(*it);
}
}
#include "xorgOptions.moc"

@ -0,0 +1,63 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _XORG_OPTIONS_H_
#define _XORG_OPTIONS_H_
#include <qframe.h>
#include <qspinbox.h>
#include <kpopupmenu.h>
#include <kconfig.h>
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kurl.h>
#include <kaction.h>
#include "globals.h"
#include "fileList.h"
class XorgOptions : public QWidget {
Q_OBJECT
public:
XorgOptions(QWidget *parent = 0);
~XorgOptions();
bool isValid();
public slots:
void saveConfig();
void readConfig();
void slotFileListChanged(int itemLeft);
signals:
void optionsChanged(bool valid);
private:
FileList* fileList;
};
#endif

@ -0,0 +1,119 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <qpair.h>
#include <klocale.h>
#include <kmessagebox.h>
#include "xorgReader.h"
#define CONFIG_FILE_LOG_LEVEL_ICON "configure"
#define DEFAULT_SETTING_LOG_LEVEL_ICON "configure_toolbars"
#define COMMAND_LINE_LOG_LEVEL_ICON "konsole"
#define PROBED_LOG_LEVEL_ICON "wizard"
#define NOT_IMPLEMENTED_LOG_LEVEL_ICON "filenew"
XorgReader::XorgReader(QObject *parent, const char *name) :
DefaultReader(parent, name),
newLineTime(),
newLineDate(QDate::currentDate()),
lineCount(1)
{
initializeTypeName();
}
XorgReader::~XorgReader() {
}
void XorgReader::initColumns(LogViewColumns* columns) {
lineCount=1;
columns->append(new LogViewColumn(i18n("Line"), false, false));
columns->append(new LogViewColumn(i18n("Type"), false, false));
columns->append(new LogViewColumn(i18n("Message"), false, false));
columns->setGroupByDay(false);
columns->setGroupByHour(false);
}
LogLine* XorgReader::parseMessage(QString& string, LogFile* originalFile) {
QString type;
type=string.left(4);
LogLevel* logLineType=this->getTypeName(type);
//If the type is not empty, the log message has a type, so we can delete it
if (logLineType!=NULL) {
string=string.remove(0, 5);
}
else {
logLineType=Globals::informationLogLevel;
}
QStringList list;
//list.append(i18n("# %1").arg(lineCount));
list.append(logLineType->name);
list.append(string);
lineCount++;
//Substracts 1 millisec to the line time, to allow sorting
newLineTime=newLineTime.addMSecs(-1);
QString filePath=originalFile->url.path();
LogLine* logLine=new LogLine(newLineDate, newLineTime, list, filePath, logLineType, Globals::xorgMode->id);
return(logLine);
}
void XorgReader::initializeTypeName() {
xorgLevels["(--)"]=new LogLevel(20, i18n("probed"), PROBED_LOG_LEVEL_ICON, QColor(240, 220, 3));
xorgLevels["(**)"]=new LogLevel(21, i18n("from config file"), CONFIG_FILE_LOG_LEVEL_ICON, QColor(161, 133, 240));
xorgLevels["(==)"]=new LogLevel(22, i18n("default setting"), DEFAULT_SETTING_LOG_LEVEL_ICON, QColor(169, 189, 165));
xorgLevels["(++)"]=new LogLevel(23, i18n("from command Line"), COMMAND_LINE_LOG_LEVEL_ICON, QColor(179, 181, 214));
xorgLevels["(!!)"]=Globals::noticeLogLevel;
xorgLevels["(II)"]=Globals::informationLogLevel;
xorgLevels["(WW)"]=Globals::warningLogLevel;
xorgLevels["(EE)"]=Globals::errorLogLevel;
xorgLevels["(NI)"]=new LogLevel(24, i18n("not implemented"), NOT_IMPLEMENTED_LOG_LEVEL_ICON, QColor(136, 146, 240));
xorgLevels["(\?\?)"]=Globals::noneLogLevel;
}
LogLevel* XorgReader::getTypeName(const QString type) {
QMap<QString, LogLevel*>::iterator it;
it=xorgLevels.find(type);
if (it!=xorgLevels.end())
return(*it);
else
return(NULL);
}
#include "xorgReader.moc"

@ -0,0 +1,66 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _XORG_READER_H_
#define _XORG_READER_H_
#include <qobject.h>
#include <qstringlist.h>
#include <qmap.h>
#include <qfile.h>
#include <qpair.h>
#include <kurl.h>
#include "globals.h"
#include "defaultReader.h"
/**
* @author Nicolas Ternisien
*/
class XorgReader : public DefaultReader {
Q_OBJECT
public:
XorgReader(QObject *parent = 0, const char *name = 0);
virtual ~XorgReader();
virtual void initColumns(LogViewColumns* columns);
protected:
virtual LogLine* parseMessage(QString& buffer, LogFile* originalFile);
QMap<QString, LogLevel*> xorgLevels;
void initializeTypeName();
LogLevel* getTypeName(const QString type);
QTime newLineTime;
QDate newLineDate;
int lineCount;
};
#endif

@ -0,0 +1,3 @@
doc
po
src

@ -0,0 +1,19 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/

@ -0,0 +1,19 @@
/***************************************************************************
* Copyright (C) 2005 by Nicolas Ternisien *
* nicolas.ternisien@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/

@ -0,0 +1 @@
ksystemlog
Loading…
Cancel
Save