aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/db/attachguard.cpp
blob: bcd489035c1f45f584171096e1080db43261c812 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "attachguard.h"
#include "db/db.h"

GuardedAttach::GuardedAttach(Db* db, Db* attachedDb, const QString& attachName) :
    db(db), attachedDb(attachedDb), name(attachName)
{
}

GuardedAttach::~GuardedAttach()
{
    if (name.isNull())
        return;

    db->detach(attachedDb);
}

QString GuardedAttach::getName() const
{
    return name;
}