urlhook.cpp 1.21 KB
Newer Older
1
/*
2 3 4
 *  Copyright (C) 2009 Savoir-Faire Linux inc.
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
 *
5 6 7 8
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
9
 *
10 11 12 13
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
14
 *
15 16 17 18 19
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

20
#include "urlhook.h"
21 22 23
#include <iostream>

UrlHook::UrlHook () { }
24

25
UrlHook::~UrlHook () { }
26

27 28
int UrlHook::addAction (std::string field_value, std::string command)
{
29

30
    std::string command_bg;
31

32 33 34
    /* Execute the command in the background to not block the application */
    command_bg = command + " " + field_value + "&" ;
    /* Execute a system call */
35
    return RUN_COMMAND (command_bg.c_str());
36

Emmanuel Milou's avatar
Emmanuel Milou committed
37 38 39
}