ossp-pkg/as/as-gui/as_assist.cpp 1.87 -> 1.88
--- as_assist.cpp 2003/01/28 17:33:55 1.87
+++ as_assist.cpp 2003/01/29 17:05:31 1.88
@@ -1036,47 +1036,31 @@
}
//
-// Check command line arguments, and parse for an existing filename
-// Returns the number of unhandled arguments, possibly multiple filenames
+// Parse command line arguments for an existing filename, and
+// open it to edit the intended (but optional) initial data
//
-int Titraqform::setupCmdargs(void)
+void Titraqform::loadInit(void)
{
// If the user gives a filename argument to the shell, then open that file
int nNumargs = qApp->argc(); // Holds the number of cmd arguments
- int nRet = 0; // Holds the return value
+ int nValid = 0; // Holds the return value
+ QFile Initial; // Initial event data file
if (nNumargs > 1) { // Warm up a nice cascade, to set my mind on four weeks of vacation
for (int nIter = 1; nIter < nNumargs; nIter++) { // Salad in New Zealand
if (QChar(*qApp->argv()[nIter]) != '-') { // Bunuelos in Colombia
this->setFilename(qApp->argv()[nIter]); // Store inital filename
- if (QFile::exists(*getFilename()))
- return ++nRet; // Handled the filename
- else
- ++nRet;
+ Initial.setName(*this->getFilename()); // Initial file to load
+ if (Initial.exists(*getFilename())) {
+ this->loadData(Initial); // Pass to helper method
+ enableIface(true); // Turn on the lights
+ m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename());
+ }
+ else // The inital file name does not correspond to a file
+ m_pStatbar->message(trUtf8(QString("The file ") + *this->getFilename() + QString(" does not exist.")));
}
}
- if (nRet > 0)
- return -1; // Return a general initial file error
}
- return nRet; // Return the number of unhandled arguments
-}
-
-//
-// Opens an inital event data file if one exists
-//
-void Titraqform::setupInitdata(int nFilearg)
-{
- // Logic left over from setupCmdargs to help decide what our cmd parsing did
- if (nFilearg == 0) // Args handled, no initial file
+ else
m_pStatbar->message(trUtf8("Ready")); // Signal a ready condition
- else if (nFilearg > 0) { // Args handled, found initial file
- QFile Initial; // Initial event data file to edit
- Initial.setName(*this->getFilename()); // Initial file to load
- this->loadData(Initial); // Pass to helper method
- enableIface(true); // Turn on the lights
- m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename());
- }
- else // The inital file name does not correspond to a file
- m_pStatbar->message(trUtf8(QString("The file ") + *this->getFilename() + QString(" does not exist.")));
-
}
|
|