d1vanov/libquentier

Stop using deprecated QString::sprintf method

Closed this issue · 0 comments

/home/dmitry/workspace/MyOpenSourceProjects/libquentier-master/src/enml/ENMLConverter_p.cpp: In function ‘void quentier::xmlValidationErrorFunc(void*, const char*, __va_list_tag*)’:
/home/dmitry/workspace/MyOpenSourceProjects/libquentier-master/src/enml/ENMLConverter_p.cpp:86:35: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
     currentError.sprintf(msg, args);
                                   ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QString:1:0,
                 from /home/dmitry/workspace/MyOpenSourceProjects/libquentier-master/headers/quentier/utility/Macros.h:23,
                 from /home/dmitry/workspace/MyOpenSourceProjects/libquentier-master/headers/quentier/utility/Printable.h:23,
                 from /home/dmitry/workspace/MyOpenSourceProjects/libquentier-master/headers/quentier/enml/ENMLConverter.h:22,
                 from /home/dmitry/workspace/MyOpenSourceProjects/libquentier-master/src/enml/ENMLConverter_p.h:22,
                 from /home/dmitry/workspace/MyOpenSourceProjects/libquentier-master/src/enml/ENMLConverter_p.cpp:19:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:382:14: note: declared here
     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
              ^~~~~~~

Need to figure out what it can be replaced with. One option is vsprintf. Maybe there're other better options, need to investigate.