• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

gschecker.cpp

00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License version 2 as published by the Free Software Foundation.
00008  *
00009  *  This library is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *  Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this library; see the file COPYING.LIB.  If not, write to
00016  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  *  Boston, MA 02110-1301, USA.
00018  **/
00019 
00020 #include "gschecker.h"
00021 #include "kpipeprocess.h"
00022 
00023 #include <tqfile.h>
00024 #include <tqtextstream.h>
00025 
00026 GsChecker::GsChecker(TQObject *parent, const char *name)
00027 : TQObject(parent,name)
00028 {
00029 }
00030 
00031 bool GsChecker::checkGsDriver(const TQString& name)
00032 {
00033     if (m_driverlist.count() == 0)
00034         loadDriverList();
00035     return m_driverlist.contains(name);
00036 }
00037 
00038 void GsChecker::loadDriverList()
00039 {
00040     KPipeProcess    proc;
00041     if (proc.open("gs -h",IO_ReadOnly))
00042     {
00043         QTextStream t(&proc);
00044         QString buffer, line;
00045         bool    ok(false);
00046         while (!t.eof())
00047         {
00048             line = t.readLine().stripWhiteSpace();
00049             if (ok)
00050             {
00051                 if (line.find(':') != -1)
00052                     break;
00053                 else
00054                     buffer.append(line).append(" ");
00055             }
00056             else if (line.startsWith(TQString::fromLatin1("Available devices:")))
00057                 ok = true;
00058         }
00059         m_driverlist = TQStringList::split(' ',buffer,false);
00060     }
00061 }

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.6.3
This website is maintained by Timothy Pearson.