[Marble-bugs] [marble] [Bug 336097] New: Pointing a MarbleWidget to a Different Tile Location

hwdchiva miguel.duenas at gmail.com
Wed Jun 11 20:14:36 UTC 2014


https://bugs.kde.org/show_bug.cgi?id=336097

            Bug ID: 336097
           Summary: Pointing a MarbleWidget to a Different Tile Location
    Classification: Unclassified
           Product: marble
           Version: unspecified
          Platform: unspecified
                OS: All
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: marble-bugs at kde.org
          Reporter: miguel.duenas at gmail.com

Created attachment 87138
  --> https://bugs.kde.org/attachment.cgi?id=87138&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Marble-bugs mailing list