Subversion Repositories svn1

Rev

Rev 388 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 388 Rev 389
Line 24... Line 24...
24
 
24
 
25
 
25
 
26
/*
26
/*
27
**  Local definitions
27
**  Local definitions
28
*/
28
*/
29
char        datfile[20];                         /* Name of the data file */
29
QString     DatFile;                            /* Name of the data file */
30
char        filebase[20];                        /* Event file name base */
30
QString     FileBase;                           /* Event file name base */
31
char        filepath[300];
31
QString     FilePath;
32
 
32
 
33
/*----------------------------------------------------------------------------
33
/*----------------------------------------------------------------------------
34
** FUNCTION           : QmConfig 
34
** FUNCTION           : QmConfig 
35
**
35
**
36
** DESCRIPTION        : Constructor
36
** DESCRIPTION        : Constructor
Line 76... Line 76...
76
        fileName.append(".cnf");
76
        fileName.append(".cnf");
77
    }
77
    }
78
    if (cnfFile.isEmpty())
78
    if (cnfFile.isEmpty())
79
    {
79
    {
80
        fileName = QFileDialog::getOpenFileName(0, "Select Config File",
80
        fileName = QFileDialog::getOpenFileName(0, "Select Config File",
81
                                                         filepath,
81
                                                         FilePath,
82
                                                         "Data (*.cnf);;All (*.*)"
82
                                                         "Data (*.cnf);;All (*.*)"
83
                                                         );
83
                                                         );
84
    }
84
    }
85
 
85
 
86
    //  No file selected
86
    //  No file selected
Line 93... Line 93...
93
 
93
 
94
    //
94
    //
95
    //  Setup file names
95
    //  Setup file names
96
    //
96
    //
97
    QFileInfo info (fileName);
97
    QFileInfo info (fileName);
98
    strncpy(filebase, qPrintable(info.baseName()), 8);
98
    FileBase = info.baseName();
99
    strcpy( datfile, filebase );
99
    DatFile = FileBase + ".dat";
-
 
100
 
100
    strcat( datfile, ".dat" );
101
    FilePath = info.absolutePath() + "/";
101
 
102
 
102
    strncpy(filepath, qPrintable(info.absolutePath()), sizeof(filepath)-3);
103
    qDebug() << "FilePath:" << FilePath;
103
    strcat(filepath, "/");
104
    qDebug() << "FileBase:" << FileBase;
104
    qDebug("FilePath:%s", filepath );
105
    qDebug() << "DatFile:" << DatFile;
-
 
106
 
105
 
107
 
106
    // Locate the .ini file used to store additional information
108
    // Locate the .ini file used to store additional information
107
    appSettings = new QSettings(getAddendemFile("mara.ini", true), QSettings::IniFormat);
109
    appSettings = new QSettings(getAddendemFile("mara.ini", true), QSettings::IniFormat);
108
    //qDebug() << "AppSetting: " << appSettings->fileName() << "\n";
110
    //qDebug() << "AppSetting: " << appSettings->fileName();
109
 
111
 
110
    if ( !open_read_config() )
112
    if ( !open_read_config() )
111
    {
113
    {
112
        if (QMessageBox::Cancel == QMessageBox::question ( 0,
114
        if (QMessageBox::Cancel == QMessageBox::question ( 0,
113
                                                       "Config Load Error",
115
                                                       "Config Load Error",
Line 144... Line 146...
144
        /*
146
        /*
145
        **  Post read calculations and fixups
147
        **  Post read calculations and fixups
146
        */
148
        */
147
        if( datafilename[0] )
149
        if( datafilename[0] )
148
        {
150
        {
149
            strcpy( datfile, datafilename );
151
            DatFile = QString(datafilename);
150
            strcat( datfile, ".dat" );
152
            DatFile.append(".dat");
151
        }
153
        }
152
        nonequestrian_class = lookup_class( nonequestrian_class_abr );
154
        nonequestrian_class = lookup_class( nonequestrian_class_abr );
153
 
155
 
154
        class_ne_winners_by_class = false;
156
        class_ne_winners_by_class = false;
155
        for( int i = 0; i < MAX_CLASS; i++ )
157
        for( int i = 0; i < MAX_CLASS; i++ )
Line 376... Line 378...
376
    if (name.isEmpty())
378
    if (name.isEmpty())
377
        return NULL;
379
        return NULL;
378
 
380
 
379
    QFile file;
381
    QFile file;
380
    QString addendumFileName;
382
    QString addendumFileName;
381
    addendumFileName = filepath;
383
    addendumFileName = FilePath;
382
    addendumFileName.append(name);
384
    addendumFileName.append(name);
383
    QString addendumFileNamePreferred(addendumFileName);
385
    QString addendumFileNamePreferred(addendumFileName);
384
    file.setFileName(addendumFileName);
386
    file.setFileName(addendumFileName);
385
    //qDebug("Try:%s", qPrintable(addendumFileName));
387
    //qDebug("Try:%s", qPrintable(addendumFileName));
386
    if ( !file.exists())
388
    if ( !file.exists())