Index: ossp-pkg/as/as-gui/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v rcsdiff -q -kk '-r1.13' '-r1.14' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v' 2>/dev/null --- Makefile.in 2002/11/20 22:04:24 1.13 +++ Makefile.in 2002/11/22 11:46:32 1.14 @@ -65,9 +65,9 @@ TARGET_PROGS = titraq TARGET_MANS = titraq.1 titraq.conf.5 -SRCS = main.cpp titraq.cpp titassist.cpp titslot.cpp titrex.cpp generic.cpp titraq_version.c +SRCS = main.cpp titraq.cpp titassist.cpp titslot.cpp tidatops.cpp titrex.cpp generic.cpp titraq_version.c -OBJS = main.o titraq.o titassist.o titslot.o titrex.o generic.o titraq_version.o +OBJS = main.o titraq.o titassist.o titslot.o tidatops.o titrex.o generic.o titraq_version.o GRAFX = gfx/ossplogo.xpm Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- TODO 2002/11/21 15:37:08 1.8 +++ TODO 2002/11/22 11:46:32 1.9 @@ -16,7 +16,7 @@ QWhatsThis::add(m_pAddbutton, trUtf8("Para soltar la pepa")); configure soll ueberpruefen ob libqt[-mt] threads braucht, dann wenn so, soll den LIBS -pthread hardgecodet haben -Report errors in all slot code by throwing exceptions +Report errors in all slot code and tidatops by throwing exceptions Dreams ------ Index: ossp-pkg/as/as-gui/as_dataop.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v' | diff -u /dev/null - -L'ossp-pkg/as/as-gui/as_dataop.cpp' 2>/dev/null --- ossp-pkg/as/as-gui/as_dataop.cpp +++ - 2025-05-20 13:37:47.426331928 +0200 @@ -0,0 +1,31 @@ +#include "titraq.h" + + +// +// Convenience method to load accounting data from a file +// +void Titraqform::loadData(QFile &Fileobj) +{ + if (Fileobj.isOpen()) { // Check state of file + Fileobj.flush(); // Begin processing file cleanly + QTextStream Asentry(&Fileobj); // Convert data to stream + loadData(Asentry); // Pass off to do the real work + } + else { + if (!Fileobj.open(IO_ReadOnly)) // Need a wrapped exception here, + return; // instead of a short circuit + QTextStream Asentry(&Fileobj); // Convert data to stream + loadData(Asentry); // Pass off to do the real work + Fileobj.close(); // Finish fileop by closing + } +} + +// +// Load accounting data from a stream +// +void Titraqform::loadData(QTextStream &Tstream) +{ + m_pRemark->setText(Tstream.readLine()); // Read from stream + m_pRemark->setEdited(false); // Reset widget +} + Index: ossp-pkg/as/as-gui/as_gui.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v rcsdiff -q -kk '-r1.16' '-r1.17' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2002/11/21 15:37:08 1.16 +++ as_gui.h 2002/11/22 11:46:32 1.17 @@ -14,6 +14,7 @@ #include #include #include +#include // Intentional no operation #define TITRAQ_NOP ((void)0) @@ -65,7 +66,6 @@ void writeEntry(void); // Write the task list to a filedescriptor void newDoc(void); // Make and display a new document window void chooseFile(void); // Choose a file using a handy file dialog - void loadData(const QString &); // Load accounting data into main window void saveFile(void); // Serialize to the current file void saveAs(void); // Serialize to a selected file void helpContents(void); // Use the help contents @@ -118,6 +118,10 @@ void setupEditlay(void); // Editing lay void setupButtons(void); // Push button widgets void setupPieces(void); // Assemble widget pieces + + // Data processing + void loadData(QFile &); // Load accounting data from file + void loadData(QTextStream &); // Load accounting data from stream }; #endif // TITRAQMWIN_H Index: ossp-pkg/as/as-gui/as_slot.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- as_slot.cpp 2002/11/21 15:37:08 1.6 +++ as_slot.cpp 2002/11/22 11:46:32 1.7 @@ -1,5 +1,4 @@ // Qt headers -#include #include // User interface @@ -61,31 +60,18 @@ // void Titraqform::chooseFile(void) { - QString Filestring = QFileDialog::getOpenFileName("/e/dev/as", QString::null, this, trUtf8("Chooser Dialog"), trUtf8("Choose a file to open")); - if (!Filestring.isEmpty()) - loadData(Filestring); + QString Filestring = QFileDialog::getOpenFileName("/export/home/mschloh/tmp/bifftest/ms.txt", QString::null, this, trUtf8("Chooser Dialog"), trUtf8("Choose a file to open")); + if (!Filestring.isEmpty()) { + QFile Filetemp(Filestring); // File to load + loadData(Filetemp); // Pass to helper method + setCaption(Filestring); + m_pStatbar->message(trUtf8("Loaded document ") + Filestring, 4000); + } else m_pStatbar->message(trUtf8("Loading aborted"), 4000); } // -// Load accounting data into main window -// -void Titraqform::loadData(const QString &Filestring) -{ - QFile Filetemp(Filestring); // File to load - - if (!Filetemp.open(IO_ReadOnly)) // Need a wrapped exception here - return; - - QTextStream Textstream(&Filetemp); // Convert the file contents to a stream - m_pRemark->setText(Textstream.read()); - m_pRemark->setEdited(false); - setCaption(Filestring); - m_pStatbar->message(trUtf8("Loaded document ") + Filestring, 4000); -} - -// // Serialize current state to the current file // void Titraqform::saveFile(void)