as_sfile.cpp

changeset 3
c1941114ca88
parent 1
d64aaa7d146f
child 12
ceb4ba3d2d00
     1.1 --- a/as_sfile.cpp	Fri Nov 28 14:20:00 2008 +0100
     1.2 +++ b/as_sfile.cpp	Fri Dec 05 23:14:02 2008 +0100
     1.3 @@ -1,12 +1,12 @@
     1.4  //
     1.5  //  OSSP asgui - Accounting system graphical user interface
     1.6 -//  Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/)
     1.7 -//  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>
     1.8 -//  Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com>
     1.9 -//  Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH
    1.10 +//  Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/)
    1.11 +//  Copyright (c) 2002-2008 Ralf S. Engelschall <rse@engelschall.com>
    1.12 +//  Copyright (c) 2002-2008 Michael Schloh von Bennewitz <michael@schloh.com>
    1.13 +//  Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH
    1.14  //
    1.15  //  This file is part of OSSP asgui, an accounting system graphical user
    1.16 -//  interface which can be found at http://www.ossp.org/pkg/tool/asgui/.
    1.17 +//  interface which can be found at http://asgui.europalab.com/.
    1.18  //
    1.19  //  Permission to use, copy, modify, and distribute this software for
    1.20  //  any purpose with or without fee is hereby granted, provided that
    1.21 @@ -32,6 +32,9 @@
    1.22  #include "as_sfile.h"
    1.23  #include "as_except.h"
    1.24  
    1.25 +//Added by qt3to4:
    1.26 +#include <Q3TextStream>
    1.27 +
    1.28  
    1.29  //
    1.30  // Serialize a backup of an incoming file object
    1.31 @@ -41,17 +44,17 @@
    1.32      QFile Filein;           // Input readonly file
    1.33      QFile Filebak;          // Backup writeonly file
    1.34      QString Fname;          // Filename of input file
    1.35 -    QTextStream Streamin;   // Stream to read from (Filein)
    1.36 -    QTextStream Streambak;  // Stream to write to (Filebak)
    1.37 +    Q3TextStream Streamin;   // Stream to read from (Filein)
    1.38 +    Q3TextStream Streambak;  // Stream to write to (Filebak)
    1.39  
    1.40      try {
    1.41          if(!this->exists())                 // Conditionally short circuit if
    1.42              return;                         // file to backup does not exist
    1.43          Fname = this->name();               // Copy filename from original
    1.44          Filein.setName(Fname);              // Set filename of original
    1.45 -        Filein.open(IO_ReadOnly);           // Open original read-only
    1.46 +        Filein.open(QIODevice::ReadOnly);           // Open original read-only
    1.47          Filebak.setName(Fname + ".bak");    // Set filename of backup
    1.48 -        Filebak.open(IO_WriteOnly);         // Open backup write-only
    1.49 +        Filebak.open(QIODevice::WriteOnly);         // Open backup write-only
    1.50          Streamin.setDevice(&Filein);        // Set incoming stream
    1.51          Streambak.setDevice(&Filebak);      // Set outgoing stream
    1.52          Streambak << Streamin.read();       // Do actual writing

mercurial