mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
Use sys::path and ARDOUR::user_config_directory in ARDOUR::read/write_recent_sessions
git-svn-id: svn://localhost/ardour2/trunk@2045 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
7459379ec4
commit
e71ec730bf
1 changed files with 18 additions and 4 deletions
|
|
@ -23,19 +23,30 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <pbd/error.h>
|
#include <pbd/error.h>
|
||||||
#include <ardour/configuration.h>
|
#include <ardour/configuration.h>
|
||||||
|
#include <ardour/filesystem_paths.h>
|
||||||
#include <ardour/recent_sessions.h>
|
#include <ardour/recent_sessions.h>
|
||||||
#include <ardour/utils.h>
|
#include <ardour/utils.h>
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
const char * const recent_file_name = "recent";
|
||||||
|
|
||||||
|
} // anonymous
|
||||||
|
|
||||||
int
|
int
|
||||||
ARDOUR::read_recent_sessions (RecentSessions& rs)
|
ARDOUR::read_recent_sessions (RecentSessions& rs)
|
||||||
{
|
{
|
||||||
string path = get_user_ardour_path();
|
sys::path recent_file_path(user_config_directory());
|
||||||
path += "/recent";
|
|
||||||
|
recent_file_path /= recent_file_name;
|
||||||
|
|
||||||
|
const string path = recent_file_path.to_string();
|
||||||
|
|
||||||
ifstream recent (path.c_str());
|
ifstream recent (path.c_str());
|
||||||
|
|
||||||
|
|
@ -82,8 +93,11 @@ ARDOUR::read_recent_sessions (RecentSessions& rs)
|
||||||
int
|
int
|
||||||
ARDOUR::write_recent_sessions (RecentSessions& rs)
|
ARDOUR::write_recent_sessions (RecentSessions& rs)
|
||||||
{
|
{
|
||||||
string path = get_user_ardour_path();
|
sys::path recent_file_path(user_config_directory());
|
||||||
path += "/recent";
|
|
||||||
|
recent_file_path /= recent_file_name;
|
||||||
|
|
||||||
|
const string path = recent_file_path.to_string();
|
||||||
|
|
||||||
ofstream recent (path.c_str());
|
ofstream recent (path.c_str());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue