~cern-kicad/kicad/kicad-pns-tom

« back to all changes in this revision

Viewing changes to common/edaappl.cpp

  • Committer: Maciej Suminski
  • Date: 2013-08-02 13:57:24 UTC
  • mfrom: (4024.1.238 kicad)
  • mto: This revision was merged to the branch mainline in revision 4221.
  • Revision ID: maciej.suminski@cern.ch-20130802135724-gix6orezshkukodv
Upstream merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
452
452
    m_BinDir = FROM_UTF8( native_str );
453
453
    delete[] native_str;
454
454
 
455
 
    // Linux and Unix
456
 
#elif defined(__UNIX__)
 
455
#elif defined(__UNIX__)     // Linux and non-Apple Unix
457
456
    m_BinDir = wxStandardPaths::Get().GetExecutablePath();
 
457
 
458
458
#else
459
459
    m_BinDir = argv[0];
460
 
#endif // __UNIX__
 
460
#endif
461
461
 
462
 
    /* Use unix notation for paths. I am not sure this is a good idea,
463
 
     * but it simplify compatibility between Windows and Unices
464
 
     * However it is a potential problem in path handling under Windows
465
 
     */
 
462
    // Use unix notation for paths. I am not sure this is a good idea,
 
463
    // but it simplify compatibility between Windows and Unices
 
464
    // However it is a potential problem in path handling under Windows
466
465
    m_BinDir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
467
466
 
468
467
    // Remove file name form command line:
886
885
    for( i = 0; i < m_searchPaths.GetCount(); i++ )
887
886
    {
888
887
        fn = wxFileName( m_searchPaths[i], wxEmptyString );
889
 
 
890
888
        if( subdirs )
891
889
        {
892
890
            for( j = 0; j < subdirs->GetCount(); j++ )
1133
1131
    }
1134
1132
}
1135
1133
 
 
1134
 
1136
1135
bool EDA_APP::LockFile( const wxString& fileName )
1137
1136
{
1138
1137
    // first make absolute and normalize, to avoid that different lock files
1139
1138
    // for the same file can be created
1140
1139
    wxFileName fn = fileName;
 
1140
 
1141
1141
    fn.MakeAbsolute();
1142
1142
 
1143
1143
    // semaphore to protect the edition of the file by more than one instance
1146
1146
        // it means that we had an open file and we are opening a different one
1147
1147
        delete m_oneInstancePerFileChecker;
1148
1148
    }
 
1149
 
1149
1150
    wxString lockFileName = fn.GetFullPath() + wxT( ".lock" );
 
1151
 
1150
1152
    lockFileName.Replace( wxT( "/" ), wxT( "_" ) );
 
1153
 
1151
1154
    // We can have filenames coming from Windows, so also convert Windows separator
1152
1155
    lockFileName.Replace( wxT( "\\" ), wxT( "_" ) );
 
1156
 
1153
1157
    m_oneInstancePerFileChecker = new wxSingleInstanceChecker( lockFileName );
 
1158
 
1154
1159
    if( m_oneInstancePerFileChecker &&
1155
1160
        m_oneInstancePerFileChecker->IsAnotherRunning() )
1156
1161
    {