Bug 336097 - Pointing a MarbleWidget to a Different Tile Location
Summary: Pointing a MarbleWidget to a Different Tile Location
Status: REPORTED
Alias: None
Product: marble
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-11 20:14 UTC by hwdchiva
Modified: 2014-06-11 20:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Proposed Changes Diff (10.42 KB, text/plain)
2014-06-11 20:14 UTC, hwdchiva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hwdchiva 2014-06-11 20:14:36 UTC
Created attachment 87138 [details]
Proposed Changes Diff

Currently, Marble downloads tiles to a default location, such as "/home/.local/share" for Non-windows environments or "C:\..\AppData\Roaming\.marble\data" for Windows. Here is the function where these get set:

QString MarbleDirs::localPath() 
{
#ifndef Q_OS_WIN
    QString dataHome = getenv( "XDG_DATA_HOME" );
    if( dataHome.isEmpty() )
        dataHome = QDir::homePath() + "/.local/share";

    return dataHome + "/marble"; // local path
#else
	HWND hwnd = 0;
	WCHAR *appdata_path = new WCHAR[MAX_PATH+1];
    
	SHGetSpecialFolderPathW( hwnd, appdata_path, CSIDL_APPDATA, 0 );
	QString appdata = QString::fromUtf16( reinterpret_cast<ushort*>( appdata_path ) );
	delete[] appdata_path;
	return QString( QDir::fromNativeSeparators( appdata ) + "/.marble/data" ); // local path
#endif
}

I'm developing an application where it would be useful to set this "localPath" to a location the user desires. The application runs offline, so the user has to download maps into a thumb drive, then upload them to the host computer running this application. Although uploading the tiles to "C:\..\AppData\Roaming\.marble\data" is doable, it would be easier to upload them to something like "C:/MarbleMaps".

I have updated my local version of Marble (KDE/4.12) to allow a MarbleWidget to take a "localPath" as a parameter. I have attached a text file documented the changes I have made. By documented, I mean the "git diff" output.