mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Move intdup to qthelper
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
0d36b6e4e8
commit
ab1813a445
4 changed files with 12 additions and 18 deletions
|
@ -1509,3 +1509,12 @@ QString getUUID()
|
|||
uuidString.replace("{", "").replace("}", "");
|
||||
return uuidString;
|
||||
}
|
||||
|
||||
char *intdup(int index)
|
||||
{
|
||||
char tmpbuf[21];
|
||||
|
||||
snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index);
|
||||
tmpbuf[20] = 0;
|
||||
return strdup(tmpbuf);
|
||||
}
|
||||
|
|
|
@ -46,5 +46,6 @@ extern "C" enum deco_mode decoMode();
|
|||
extern "C" void subsurface_mkdir(const char *dir);
|
||||
void init_proxy();
|
||||
QString getUUID();
|
||||
char *intdup(int index);
|
||||
|
||||
#endif // QTHELPER_H
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <QDrag>
|
||||
#include <QMimeData>
|
||||
#include <QRegExp>
|
||||
#include "core/qthelper.h"
|
||||
|
||||
static QString subsurface_mimedata = "subsurface/csvcolumns";
|
||||
static QString subsurface_index = "subsurface/csvindex";
|
||||
|
@ -742,15 +743,6 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
|||
resultModel->setData(resultModel->index(0, i),headers.at(i),Qt::EditRole);
|
||||
}
|
||||
|
||||
char *intdup(int index)
|
||||
{
|
||||
char tmpbuf[21];
|
||||
|
||||
snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index);
|
||||
tmpbuf[20] = 0;
|
||||
return strdup(tmpbuf);
|
||||
}
|
||||
|
||||
int DiveLogImportDialog::setup_csv_params(QStringList r, char **params, int pnr)
|
||||
{
|
||||
params[pnr++] = strdup("dateField");
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "core/file.h"
|
||||
#include "core/divelist.h"
|
||||
#include <QTextStream>
|
||||
#include "core/qthelper.h"
|
||||
|
||||
/* We have to use a macro since QCOMPARE
|
||||
* can only be called from a test method
|
||||
|
@ -42,15 +43,6 @@ void TestParse::cleanup()
|
|||
sqlite3_close(_sqlite3_handle);
|
||||
}
|
||||
|
||||
char *intdup(int index)
|
||||
{
|
||||
char tmpbuf[21];
|
||||
|
||||
snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index);
|
||||
tmpbuf[20] = 0;
|
||||
return strdup(tmpbuf);
|
||||
}
|
||||
|
||||
int TestParse::parseCSV(int units, std::string file)
|
||||
{
|
||||
// some basic file parsing tests
|
||||
|
|
Loading…
Reference in a new issue