Commit 774bee47 authored by Tavmjong Bah's avatar Tavmjong Bah

Give more descriptive names to document file related variables and functions.

Makes searching through code for them easier.
parent c0faa832
Pipeline #48344491 passed with stages
in 116 minutes and 15 seconds
......@@ -204,8 +204,8 @@ export_do(InkscapeApplication *app)
{
SPDocument* document = app->get_active_document();
std::string filename;
if (document->getURI()) {
filename = document->getURI();
if (document->getDocumentURI()) {
filename = document->getDocumentURI();
}
app->file_export()->do_export(document, filename);
}
......
......@@ -522,7 +522,7 @@ void SPDesktop::_setDisplayMode(Inkscape::RenderMode mode) {
_split_canvas = false;
}
redrawDesktop();
_widget->setTitle( this->getDocument()->getName() );
_widget->setTitle( this->getDocument()->getDocumentName() );
}
void SPDesktop::_setDisplayColorMode(Inkscape::ColorMode mode) {
// reload grayscale matrix from prefs
......@@ -543,7 +543,7 @@ void SPDesktop::_setDisplayColorMode(Inkscape::ColorMode mode) {
canvas->_colorrendermode = mode;
_display_color_mode = mode;
redrawDesktop();
_widget->setTitle( this->getDocument()->getName() );
_widget->setTitle( this->getDocument()->getDocumentName() );
}
void SPDesktop::displayModeToggle() {
......
......@@ -158,7 +158,7 @@ void FilterImage::render_cairo(FilterSlot &slot)
if ( !g_file_test( fullname, G_FILE_TEST_EXISTS ) ) {
// Try to load from relative position combined with document base
if( document ) {
fullname = g_build_filename( document->getBase(), feImageHref, NULL );
fullname = g_build_filename( document->getDocumentBase(), feImageHref, NULL );
}
}
if ( !g_file_test( fullname, G_FILE_TEST_EXISTS ) ) {
......
This diff is collapsed.
......@@ -128,9 +128,9 @@ public:
CRStyleSheet *style_sheet;
protected:
char *uri; ///< A filename (not a URI yet), or NULL
char *base; ///< To be used for resolving relative hrefs.
char *name; ///< basename(uri) or other human-readable label for the document.
char *document_uri; ///< A filename (not a URI yet), or NULL
char *document_base; ///< To be used for resolving relative hrefs.
char *document_name; ///< basename(uri) or other human-readable label for the document.
public:
......@@ -163,15 +163,15 @@ public:
Inkscape::XML::Document const *getReprDoc() const { return rdoc; }
/** A filename (not a URI yet), or NULL */
char const *getURI() const { return uri; }
void setUri(char const *uri);
char const *getDocumentURI() const { return document_uri; }
void setDocumentUri(char const *document_uri);
/** To be used for resolving relative hrefs. */
char const *getBase() const { return base; };
void setBase( char const* base );
char const *getDocumentBase() const { return document_base; };
void setDocumentBase( char const* document_base );
/** basename(uri) or other human-readable label for the document. */
char const* getName() const { return name; }
char const* getDocumentName() const { return document_name; }
/** Return the main defs object for the document. */
SPDefs *getDefs();
......
......@@ -522,7 +522,7 @@ SPDocument *Script::open(Inkscape::Extension::Input *module,
} // data_read
if (mydoc != nullptr) {
mydoc->setBase(nullptr);
mydoc->setDocumentBase(nullptr);
mydoc->changeUriAndHrefs(filenameArg);
}
......
......@@ -179,7 +179,7 @@ void XSLT::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar cons
}
if (!sp_repr_save_rebased_file(repr->document(), tempfilename_out.c_str(), SP_SVG_NS_URI,
doc->getBase(), filename)) {
doc->getDocumentBase(), filename)) {
throw Inkscape::Extension::Output::save_failed();
}
......
......@@ -2041,7 +2041,7 @@ void OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gcha
{
reset();
docBaseUri = Inkscape::URI::from_dirname(doc->getBase()).str();
docBaseUri = Inkscape::URI::from_dirname(doc->getDocumentBase()).str();
ZipFile zf;
preprocess(zf, doc->rroot);
......
......@@ -931,7 +931,7 @@ Svg::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filena
}
if (!sp_repr_save_rebased_file(rdoc, filename, SP_SVG_NS_URI,
doc->getBase(), //
doc->getDocumentBase(), //
m_detachbase ? nullptr : filename)) {
throw Inkscape::Extension::Output::save_failed();
}
......
......@@ -137,7 +137,7 @@ SPDocument *open(Extension *key, gchar const *filename)
}
}
doc->setUri(filename);
doc->setDocumentUri(filename);
if (!show) {
imod->set_gui(true);
}
......@@ -288,7 +288,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
// remember attributes in case this is an unofficial save and/or overwrite fails
gchar *saved_uri = g_strdup(doc->getURI());
gchar *saved_uri = g_strdup(doc->getDocumentURI());
gchar *saved_output_extension = nullptr;
gchar *saved_dataloss = nullptr;
bool saved_modified = doc->isModifiedSinceSave();
......@@ -618,8 +618,8 @@ get_file_save_path (SPDocument *doc, FileSaveMethod method) {
case FILE_SAVE_METHOD_SAVE_AS:
{
use_current_dir = prefs->getBool("/dialogs/save_as/use_current_dir", true);
if (doc->getURI() && use_current_dir) {
path = Glib::path_get_dirname(doc->getURI());
if (doc->getDocumentURI() && use_current_dir) {
path = Glib::path_get_dirname(doc->getDocumentURI());
} else {
path = prefs->getString("/dialogs/save_as/path");
}
......@@ -630,15 +630,15 @@ get_file_save_path (SPDocument *doc, FileSaveMethod method) {
break;
case FILE_SAVE_METHOD_SAVE_COPY:
use_current_dir = prefs->getBool("/dialogs/save_copy/use_current_dir", prefs->getBool("/dialogs/save_as/use_current_dir", true));
if (doc->getURI() && use_current_dir) {
path = Glib::path_get_dirname(doc->getURI());
if (doc->getDocumentURI() && use_current_dir) {
path = Glib::path_get_dirname(doc->getDocumentURI());
} else {
path = prefs->getString("/dialogs/save_copy/path");
}
break;
case FILE_SAVE_METHOD_INKSCAPE_SVG:
if (doc->getURI()) {
path = Glib::path_get_dirname(doc->getURI());
if (doc->getDocumentURI()) {
path = Glib::path_get_dirname(doc->getDocumentURI());
} else {
// FIXME: should we use the save_as path here or something else? Maybe we should
// leave this as a choice to the user.
......
......@@ -253,7 +253,7 @@ bool sp_file_save_backup( Glib::ustring uri ) {
void sp_file_convert_dpi(SPDocument *doc)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
Glib::ustring uri = doc->getURI();
Glib::ustring uri = doc->getDocumentURI();
SPRoot *root = doc->getRoot();
// See if we need to offer the user a fix for the 90->96 px per inch change.
......@@ -335,7 +335,7 @@ void sp_file_convert_dpi(SPDocument *doc)
scale_dialog.set_border_width(10);
scale_dialog.set_resizable(false);
Gtk::Label explanation;
explanation.set_markup(Glib::ustring("<b>") + doc->getName() + "</b>\n" +
explanation.set_markup(Glib::ustring("<b>") + doc->getDocumentName() + "</b>\n" +
_("was created in an older version of Inkscape (90 DPI) and we need "
"to make it compatible with newer versions (96 DPI). Tell us about this file:\n"));
explanation.set_line_wrap(true);
......
......@@ -246,7 +246,7 @@ bool sp_file_open(const Glib::ustring &uri,
doc->virgin = FALSE;
if (add_to_recent) {
sp_file_add_recent( doc->getURI() );
sp_file_add_recent( doc->getDocumentURI() );
}
// --------------- Fix up document ----------------
......@@ -307,7 +307,7 @@ void sp_file_revert_dialog()
Inkscape::XML::Node *repr = doc->getReprRoot();
g_assert(repr != nullptr);
gchar const *uri = doc->getURI();
gchar const *uri = doc->getDocumentURI();
if (!uri) {
desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved yet. Cannot revert."));
return;
......@@ -696,10 +696,10 @@ file_save(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri,
SP_ACTIVE_DESKTOP->event_log->rememberFileSave();
Glib::ustring msg;
if (doc->getURI() == nullptr) {
if (doc->getDocumentURI() == nullptr) {
msg = Glib::ustring::format(_("Document saved."));
} else {
msg = Glib::ustring::format(_("Document saved."), " ", doc->getURI());
msg = Glib::ustring::format(_("Document saved."), " ", doc->getDocumentURI());
}
SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, msg.c_str());
return true;
......@@ -755,7 +755,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens
save_loc.append(G_DIR_SEPARATOR_S);
int i = 1;
if ( !doc->getURI() ) {
if ( !doc->getDocumentURI() ) {
// We are saving for the first time; create a unique default filename
save_loc = save_loc + _("drawing") + filename_extension;
......@@ -765,7 +765,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens
save_loc = save_loc + Glib::ustring::compose(_("drawing-%1"), i++) + filename_extension;
}
} else {
save_loc.append(Glib::path_get_basename(doc->getURI()));
save_loc.append(Glib::path_get_basename(doc->getDocumentURI()));
}
// convert save_loc from utf-8 to locale
......@@ -833,8 +833,8 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens
// FIXME: does the argument !is_copy really convey the correct meaning here?
success = file_save(parentWindow, doc, fileName, selectionType, TRUE, !is_copy, save_method);
if (success && doc->getURI()) {
sp_file_add_recent( doc->getURI() );
if (success && doc->getDocumentURI()) {
sp_file_add_recent( doc->getDocumentURI() );
}
save_path = Glib::path_get_dirname(fileName);
......@@ -857,7 +857,7 @@ sp_file_save_document(Gtk::Window &parentWindow, SPDocument *doc)
bool success = true;
if (doc->isModifiedSinceSave()) {
if ( doc->getURI() == nullptr )
if ( doc->getDocumentURI() == nullptr )
{
// Hier sollte in Argument mitgegeben werden, das anzeigt, da� das Dokument das erste
// Mal gespeichert wird, so da� als default .svg ausgew�hlt wird und nicht die zuletzt
......@@ -865,7 +865,7 @@ sp_file_save_document(Gtk::Window &parentWindow, SPDocument *doc)
return sp_file_save_dialog(parentWindow, doc, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG);
} else {
Glib::ustring extension = Inkscape::Extension::get_file_save_extension(Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS);
Glib::ustring fn = g_strdup(doc->getURI());
Glib::ustring fn = g_strdup(doc->getDocumentURI());
// Try to determine the extension from the uri; this may not lead to a valid extension,
// but this case is caught in the file_save method below (or rather in Extension::save()
// further down the line).
......@@ -884,11 +884,11 @@ sp_file_save_document(Gtk::Window &parentWindow, SPDocument *doc)
}
} else {
Glib::ustring msg;
if ( doc->getURI() == nullptr )
if ( doc->getDocumentURI() == nullptr )
{
msg = Glib::ustring::format(_("No changes need to be saved."));
} else {
msg = Glib::ustring::format(_("No changes need to be saved."), " ", doc->getURI());
msg = Glib::ustring::format(_("No changes need to be saved."), " ", doc->getDocumentURI());
}
SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::WARNING_MESSAGE, msg.c_str());
success = TRUE;
......@@ -1182,7 +1182,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri,
}
if (doc != nullptr) {
Inkscape::XML::rebase_hrefs(doc, in_doc->getBase(), true);
Inkscape::XML::rebase_hrefs(doc, in_doc->getDocumentBase(), true);
Inkscape::XML::Document *xml_in_doc = in_doc->getReprDoc();
prevent_id_clashes(doc, in_doc);
......@@ -1497,7 +1497,7 @@ sp_file_export_dialog(Gtk::Window &parentWindow)
if (success) {
Glib::RefPtr<Gtk::RecentManager> recent = Gtk::RecentManager::get_default();
recent->add_item( doc->getURI() );
recent->add_item( doc->getDocumentURI() );
}
export_path = fileName;
......
......@@ -695,7 +695,7 @@ Application::crash_handler (int /*signum*/)
/* originally, the document name was retrieved from
* the sodipod:docname attribute */
docname = doc->getName();
docname = doc->getDocumentName();
if (docname) {
/* Removes an emergency save suffix if present: /(.*)\.[0-9_]*\.[0-9_]*\.[~\.]*$/\1/ */
const char* d0 = strrchr ((char*)docname, '.');
......@@ -722,7 +722,7 @@ Application::crash_handler (int /*signum*/)
// Find a location
const char* locations[] = {
doc->getBase(),
doc->getDocumentBase(),
g_get_home_dir(),
g_get_tmp_dir(),
curdir,
......@@ -746,7 +746,7 @@ Application::crash_handler (int /*signum*/)
savednames.push_back(g_strdup (c));
fclose (file);
} else {
failednames.push_back((doc->getName()) ? g_strdup(doc->getName()) : g_strdup (_("Untitled document")));
failednames.push_back((doc->getDocumentName()) ? g_strdup(doc->getDocumentName()) : g_strdup (_("Untitled document")));
}
count++;
}
......
......@@ -127,7 +127,7 @@ InkviewWindow::create_file_list(const std::vector<Glib::RefPtr<Gio::File > >& fi
void
InkviewWindow::update_title()
{
Glib::ustring title(_documents[_index]->getName());
Glib::ustring title(_documents[_index]->getDocumentName());
if (_documents.size() > 1) {
title += Glib::ustring::compose(" (%1/%2)", _index+1, _documents.size());
......
......@@ -415,8 +415,8 @@ InkFileExportCmd::do_export_png(SPDocument *doc, std::string filename_in)
if (filename_from_hint) {
//Make relative paths go from the document location, if possible:
if (!Glib::path_is_absolute(filename_out) && doc->getURI()) {
std::string dirname = Glib::path_get_dirname(doc->getURI());
if (!Glib::path_is_absolute(filename_out) && doc->getDocumentURI()) {
std::string dirname = Glib::path_get_dirname(doc->getDocumentURI());
if (!dirname.empty()) {
filename_out = Glib::build_filename(dirname, filename_out);
}
......
......@@ -232,7 +232,7 @@ std::vector<Glib::ustring> ResourceManagerImpl::findBrokenLinks( SPDocument *doc
uniques.insert(href);
}
} else {
std::string combined = Glib::build_filename(doc->getBase(), uri);
std::string combined = Glib::build_filename(doc->getDocumentBase(), uri);
if ( !Glib::file_test(combined, Glib::FILE_TEST_EXISTS) ) {
result.emplace_back(href);
uniques.insert(href);
......@@ -328,7 +328,7 @@ bool ResourceManagerImpl::fixupBrokenLinks(SPDocument *doc)
bool changed = false;
if ( doc ) {
// TODO debug g_message("FIXUP FIXUP FIXUP FIXUP FIXUP FIXUP FIXUP FIXUP FIXUP FIXUP");
// TODO debug g_message(" base is [%s]", doc->getBase());
// TODO debug g_message(" base is [%s]", doc->getDocumentBase());
std::vector<Glib::ustring> brokenHrefs = findBrokenLinks(doc);
if ( !brokenHrefs.empty() ) {
......@@ -338,7 +338,7 @@ bool ResourceManagerImpl::fixupBrokenLinks(SPDocument *doc)
}
}
std::map<Glib::ustring, Glib::ustring> mapping = locateLinks(doc->getBase(), brokenHrefs);
std::map<Glib::ustring, Glib::ustring> mapping = locateLinks(doc->getDocumentBase(), brokenHrefs);
for ( std::map<Glib::ustring, Glib::ustring>::iterator it = mapping.begin(); it != mapping.end(); ++it )
{
// TODO debug g_message(" [%s] ==> {%s}", it->first.c_str(), it->second.c_str());
......
......@@ -350,7 +350,7 @@ void ColorProfile::set(SPAttributeEnum key, gchar const *value) {
g_warning("this has no document. using active");
}
//# 1. Get complete URI of document
gchar const *docbase = doc->getURI();
gchar const *docbase = doc->getDocumentURI();
Inkscape::URI docUri("");
if (docbase) { // The file has already been saved
......
......@@ -345,7 +345,7 @@ void SPImage::update(SPCtx *ctx, unsigned int flags) {
}
this->dpi = svgdpi;
pixbuf = sp_image_repr_read_image(this->getRepr()->attribute("xlink:href"),
this->getRepr()->attribute("sodipodi:absref"), doc->getBase(), svgdpi);
this->getRepr()->attribute("sodipodi:absref"), doc->getDocumentBase(), svgdpi);
if (pixbuf) {
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
......@@ -557,7 +557,7 @@ gchar* SPImage::description() const {
svgdpi = atof(this->getRepr()->attribute("inkscape:svg-dpi"));
}
pb = sp_image_repr_read_image(this->getRepr()->attribute("xlink:href"),
this->getRepr()->attribute("sodipodi:absref"), this->document->getBase(), svgdpi);
this->getRepr()->attribute("sodipodi:absref"), this->document->getDocumentBase(), svgdpi);
if (pb) {
ret = g_strdup_printf(_("%d &#215; %d: %s"),
......
......@@ -192,14 +192,14 @@ import_style_cb (CRDocHandler *a_handler,
std::cerr << "import_style_cb: No document style sheet!" << std::endl;
return;
}
if (!document->getURI()) {
if (!document->getDocumentURI()) {
std::cerr << "import_style_cb: Document URI is NULL" << std::endl;
return;
}
// Get file
Glib::ustring import_file =
Inkscape::IO::Resource::get_filename (document->getURI(), a_uri->stryng->str);
Inkscape::IO::Resource::get_filename (document->getDocumentURI(), a_uri->stryng->str);
// Parse file
CRStyleSheet *stylesheet = cr_stylesheet_new (nullptr);
......@@ -332,7 +332,7 @@ end_font_face_cb(CRDocHandler *a_handler)
std::cerr << "end_font_face_cb: No document!" << std::endl;
return;
}
if (!document->getURI()) {
if (!document->getDocumentURI()) {
std::cerr << "end_font_face_cb: Document URI is NULL" << std::endl;
return;
}
......@@ -357,7 +357,7 @@ end_font_face_cb(CRDocHandler *a_handler)
// Get file
Glib::ustring ttf_file =
Inkscape::IO::Resource::get_filename (document->getURI(), value);
Inkscape::IO::Resource::get_filename (document->getDocumentURI(), value);
if (!ttf_file.empty()) {
font_factory *factory = font_factory::Default();
......
......@@ -130,7 +130,7 @@ void URIReference::attach(const URI &uri)
// The path contains references to separate document files to load.
if (document && uri.getPath() && !skip) {
char const *base = document->getBase();
char const *base = document->getDocumentBase();
auto absuri = URI::from_href_and_basedir(uri.str().c_str(), base);
std::string path;
......
......@@ -3634,7 +3634,7 @@ void ObjectSet::createBitmapCopy()
// Create the filename.
gchar *const basename = g_strdup_printf("%s-%s-%u.png",
doc->getName(),
doc->getDocumentName(),
items_[0]->getRepr()->attribute("id"),
current);
// Imagemagick is known not to handle spaces in filenames, so we replace anything but letters,
......@@ -3643,8 +3643,8 @@ void ObjectSet::createBitmapCopy()
// Build the complete path by adding document base dir, if set, otherwise home dir
gchar *directory = nullptr;
if ( doc->getURI() ) {
directory = g_path_get_dirname( doc->getURI() );
if ( doc->getDocumentURI() ) {
directory = g_path_get_dirname( doc->getDocumentURI() );
}
if (directory == nullptr) {
directory = Inkscape::IO::Resource::homedir_path(nullptr);
......
......@@ -375,7 +375,7 @@ Glib::ustring sp_shortcut_get_file_path()
if (open_path.empty()) {
/* Grab document directory */
const gchar* docURI = SP_ACTIVE_DOCUMENT->getURI();
const gchar* docURI = SP_ACTIVE_DOCUMENT->getDocumentURI();
if (docURI) {
open_path = Glib::path_get_dirname(docURI);
open_path.append(G_DIR_SEPARATOR_S);
......
......@@ -1271,7 +1271,7 @@ void ClipboardManagerImpl::_onGet(Gtk::SelectionData &sel, guint /*info*/)
}
if (SP_ACTIVE_DOCUMENT) {
_clipboardSPDoc->setBase(SP_ACTIVE_DOCUMENT->getBase());
_clipboardSPDoc->setDocumentBase(SP_ACTIVE_DOCUMENT->getDocumentBase());
}
(*out)->save(_clipboardSPDoc, filename, true);
......
......@@ -823,8 +823,8 @@ void ContextMenu::ImageEdit()
if (Glib::path_is_absolute(name)) {
fullname = name;
} else if (SP_ACTIVE_DOCUMENT->getBase()) {
fullname = Glib::build_filename(SP_ACTIVE_DOCUMENT->getBase(), name);
} else if (SP_ACTIVE_DOCUMENT->getDocumentBase()) {
fullname = Glib::build_filename(SP_ACTIVE_DOCUMENT->getDocumentBase(), name);
} else {
fullname = Glib::build_filename(Glib::get_current_dir(), name);
}
......
......@@ -441,10 +441,10 @@ void Export::setTargetDesktop(SPDesktop *desktop)
*/
void Export::set_default_filename () {
if ( SP_ACTIVE_DOCUMENT && SP_ACTIVE_DOCUMENT->getURI() )
if ( SP_ACTIVE_DOCUMENT && SP_ACTIVE_DOCUMENT->getDocumentURI() )
{
SPDocument * doc = SP_ACTIVE_DOCUMENT;
const gchar *uri = doc->getURI();
const gchar *uri = doc->getDocumentURI();
const gchar *text_extension = get_file_save_extension (Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS).c_str();
Inkscape::Extension::Output * oextension = nullptr;
......@@ -561,7 +561,7 @@ Glib::ustring Export::create_filepath_from_id (Glib::ustring id, const Glib::ust
if (directory.empty()) {
/* Grab document directory */
const gchar* docURI = SP_ACTIVE_DOCUMENT->getURI();
const gchar* docURI = SP_ACTIVE_DOCUMENT->getDocumentURI();
if (docURI) {
directory = Glib::path_get_dirname(docURI);
}
......@@ -952,8 +952,8 @@ Glib::ustring Export::absolutize_path_from_document_location (SPDocument *doc, c
{
Glib::ustring path;
//Make relative paths go from the document location, if possible:
if (!Glib::path_is_absolute(filename) && doc->getURI()) {
Glib::ustring dirname = Glib::path_get_dirname(doc->getURI());
if (!Glib::path_is_absolute(filename) && doc->getDocumentURI()) {
Glib::ustring dirname = Glib::path_get_dirname(doc->getDocumentURI());
if (!dirname.empty()) {
path = Glib::build_filename(dirname, filename);
}
......@@ -1236,7 +1236,7 @@ void Export::onExport ()
Inkscape::XML::Node * repr = *i;
const gchar * temp_string;
Glib::ustring dir = Glib::path_get_dirname(filename.c_str());
const gchar* docURI=SP_ACTIVE_DOCUMENT->getURI();
const gchar* docURI=SP_ACTIVE_DOCUMENT->getDocumentURI();
Glib::ustring docdir;
if (docURI)
{
......
......@@ -46,7 +46,7 @@ Print::Print(SPDocument *doc, SPItem *base) :
_printop = Gtk::PrintOperation::create();
// set up dialog title, based on document name
const Glib::ustring jobname = _doc->getName() ? _doc->getName() : _("SVG Document");
const Glib::ustring jobname = _doc->getDocumentName() ? _doc->getDocumentName() : _("SVG Document");
Glib::ustring title = _("Print");
title += " ";
title += jobname;
......
......@@ -284,7 +284,7 @@ void XmlTree::set_tree_document(SPDocument *document)
if (current_document) {
document_uri_set_connection = current_document->connectURISet(sigc::bind(sigc::ptr_fun(&on_document_uri_set), current_document));
on_document_uri_set( current_document->getURI(), current_document );
on_document_uri_set( current_document->getDocumentURI(), current_document );
set_tree_repr(current_document->getReprRoot());
} else {
set_tree_repr(nullptr);
......
......@@ -121,7 +121,7 @@ void View::setDocument(SPDocument *doc) {
_doc->connectURISet(sigc::bind(sigc::ptr_fun(&_onDocumentURISet), this));
_document_resized_connection =
_doc->connectResized(sigc::bind(sigc::ptr_fun(&_onDocumentResized), this));
_document_uri_set_signal.emit( _doc->getURI() );
_document_uri_set_signal.emit( _doc->getDocumentURI() );
}
}}}
......
......@@ -930,7 +930,7 @@ void SPDesktopWidget::updateNamedview()
modified_connection = desktop->namedview->connectModified(sigc::mem_fun(*this, &SPDesktopWidget::namedviewModified));
namedviewModified(desktop->namedview, SP_OBJECT_MODIFIED_FLAG);
updateTitle( desktop->doc()->getName() );
updateTitle( desktop->doc()->getDocumentName() );
}
/**
......@@ -1094,7 +1094,7 @@ SPDesktopWidget::shutdown()
Glib::ustring message = g_markup_printf_escaped(
_("<span weight=\"bold\" size=\"larger\">Save changes to document \"%s\" before closing?</span>\n\n"
"If you close without saving, your changes will be discarded."),
doc->getName());
doc->getDocumentName());
Gtk::MessageDialog dialog = Gtk::MessageDialog(*toplevel_window, message, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
dialog.property_destroy_with_parent() = true;
......@@ -1141,7 +1141,7 @@ SPDesktopWidget::shutdown()
Glib::ustring message = g_markup_printf_escaped(
_("<span weight=\"bold\" size=\"larger\">The file \"%s\" was saved with a format that may cause data loss!</span>\n\n"
"Do you want to save this file as Inkscape SVG?"),
doc->getName() ? doc->getName() : "Unnamed");
doc->getDocumentName() ? doc->getDocumentName() : "Unnamed");
Gtk::MessageDialog dialog = Gtk::MessageDialog(*toplevel_window, message, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
dialog.property_destroy_with_parent() = true;
......
......@@ -408,7 +408,7 @@ void
MarkerComboBox::update_marker_image(gchar const *mname)
{
gchar *cache_name = g_strconcat(combo_id, mname, NULL);
Glib::ustring key = svg_preview_cache.cache_key(doc->getURI(), cache_name, 24);
Glib::ustring key = svg_preview_cache.cache_key(doc->getDocumentURI(), cache_name, 24);
g_free (cache_name);
svg_preview_cache.remove_preview_from_cache(key);
......@@ -519,7 +519,7 @@ MarkerComboBox::create_marker_image(unsigned psize, gchar const *mname,
/* Update to renderable state */
gchar *cache_name = g_strconcat(combo_id, mname, NULL);
Glib::ustring key = svg_preview_cache.cache_key(source->getURI(), cache_name, psize);
Glib::ustring key = svg_preview_cache.cache_key(source->getDocumentURI(), cache_name, psize);
g_free (cache_name);
GdkPixbuf *pixbuf = svg_preview_cache.get_preview_from_cache(key); // no ref created
......
......@@ -136,7 +136,7 @@ void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_b
{
using Inkscape::URI;
std::string old_base_url_str = URI::from_dirname(doc->getBase()).str();
std::string old_base_url_str = URI::from_dirname(doc->getDocumentBase()).str();
std::string new_base_url_str;
if (new_base) {
......@@ -206,7 +206,7 @@ void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_b
ir->setAttribute("xlink:href", href_str);
}
doc->setBase(new_base);
doc->setDocumentBase(new_base);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment