Changeset ab1813a in subsurface


Ignore:
Timestamp:
May 6, 2017, 11:41:27 PM (7 months ago)
Author:
Miika Turkia <miika.turkia@…>
Branches:
master
Children:
0dfa448
Parents:
0d36b6e
Message:

Move intdup to qthelper

Signed-off-by: Miika Turkia <miika.turkia@…>

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/qthelper.cpp

    rb368ecd rab1813a  
    15101510        return uuidString;
    15111511}
     1512
     1513char *intdup(int index)
     1514{
     1515        char tmpbuf[21];
     1516
     1517        snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index);
     1518        tmpbuf[20] = 0;
     1519        return strdup(tmpbuf);
     1520}
  • core/qthelper.h

    rb368ecd rab1813a  
    4747void init_proxy();
    4848QString getUUID();
     49char *intdup(int index);
    4950
    5051#endif // QTHELPER_H
  • desktop-widgets/divelogimportdialog.cpp

    r9021a44 rab1813a  
    88#include <QMimeData>
    99#include <QRegExp>
     10#include "core/qthelper.h"
    1011
    1112static QString subsurface_mimedata = "subsurface/csvcolumns";
     
    741742                if (!headers.at(i).isEmpty())
    742743                        resultModel->setData(resultModel->index(0, i),headers.at(i),Qt::EditRole);
    743 }
    744 
    745 char *intdup(int index)
    746 {
    747         char tmpbuf[21];
    748 
    749         snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index);
    750         tmpbuf[20] = 0;
    751         return strdup(tmpbuf);
    752744}
    753745
  • tests/testparse.cpp

    ree1bf18 rab1813a  
    55#include "core/divelist.h"
    66#include <QTextStream>
     7#include "core/qthelper.h"
    78
    89/* We have to use a macro since QCOMPARE
     
    4142        // Some test use sqlite3, ensure db is closed
    4243        sqlite3_close(_sqlite3_handle);
    43 }
    44 
    45 char *intdup(int index)
    46 {
    47         char tmpbuf[21];
    48 
    49         snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index);
    50         tmpbuf[20] = 0;
    51         return strdup(tmpbuf);
    5244}
    5345
Note: See TracChangeset for help on using the changeset viewer.