mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 14:18:53 +02:00
We can't go to 3.0.1 yet as there are still build issues on Linux and OSX. You can get Windows to build, but there's still some display issues. These changes should work with wxWidgets 2.8.12 as well, so we can take our time to get things working properly before switching over.
66 lines
1.4 KiB
C++
66 lines
1.4 KiB
C++
/**********************************************************************
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
PlatformCompatibility.cpp
|
|
|
|
Markus Meyer
|
|
|
|
*******************************************************************//*!
|
|
|
|
\class PlatformCompatibility
|
|
\brief Filename Compatibility utilities.
|
|
|
|
\see FileNames
|
|
|
|
*//*******************************************************************/
|
|
|
|
|
|
#include <wx/filefn.h>
|
|
#include <wx/filename.h>
|
|
#include <wx/stdpaths.h>
|
|
#include <wx/app.h>
|
|
|
|
#include "AudacityApp.h"
|
|
#include "PlatformCompatibility.h"
|
|
|
|
wxString PlatformCompatibility::GetLongFileName(const wxString& shortFileName)
|
|
{
|
|
wxFileName fn(shortFileName);
|
|
|
|
return fn.GetLongPath();
|
|
}
|
|
|
|
wxString PlatformCompatibility::GetExecutablePath()
|
|
{
|
|
static bool found = false;
|
|
static wxString path;
|
|
|
|
if (!found) {
|
|
path = wxStandardPaths::Get().GetExecutablePath();
|
|
|
|
found = true;
|
|
}
|
|
|
|
return path;
|
|
}
|
|
|
|
wxString PlatformCompatibility::ConvertSlashInFileName(const wxString& filePath)
|
|
{
|
|
#ifdef __WXMAC__
|
|
wxString path = filePath;
|
|
wxString filename;
|
|
wxString newPath = filePath;
|
|
int pathLen = 1;
|
|
while (!wxDirExists(wxPathOnly(newPath)) && ! path.IsEmpty()) {
|
|
path = newPath.BeforeLast('/');
|
|
filename = newPath.AfterLast('/');
|
|
newPath = path;
|
|
newPath += ':';
|
|
newPath += filename;
|
|
}
|
|
return newPath;
|
|
#else
|
|
return filePath;
|
|
#endif
|
|
} |