aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>1999-11-05 20:38:16 +0800
committerEskil Heyn Olsen <eskil@src.gnome.org>1999-11-05 20:38:16 +0800
commitc8fce201dc8b14505f2e0387689947922e08f956 (patch)
treea411148510af63bd0818edeac3f3360b8921ab67 /calendar
parentee413a3fd2c6ee802b6af1286f1cf7a65f52c5f1 (diff)
downloadgsoc2013-evolution-c8fce201dc8b14505f2e0387689947922e08f956.tar.gz
gsoc2013-evolution-c8fce201dc8b14505f2e0387689947922e08f956.tar.zst
gsoc2013-evolution-c8fce201dc8b14505f2e0387689947922e08f956.zip
Commented the code out, thus the capplet works again.
* calendar-conduit-control-applet.c (readStateCfg): Commented the code out, thus the capplet works again. svn path=/trunk/; revision=1368
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/calendar-conduit-control-applet.c2
-rw-r--r--calendar/conduits/calendar/calendar-conduit-control-applet.c2
-rw-r--r--calendar/gui/calendar-conduit-control-applet.c2
4 files changed, 11 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index efe9b8d37a..14c2989fc1 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,8 @@
+1999-11-05 Eskil Heyn Olsen <deity@eskil.dk>
+
+ * calendar-conduit-control-applet.c (readStateCfg): Commented the
+ code out, thus the capplet works again.
+
1999-11-04 Eskil Olsen <deity@eskil.dk>
* Makefile.am: Uses the PISOCK_LIBDIR, for people with odd install
diff --git a/calendar/calendar-conduit-control-applet.c b/calendar/calendar-conduit-control-applet.c
index fb1aeeadd9..0950772d2e 100644
--- a/calendar/calendar-conduit-control-applet.c
+++ b/calendar/calendar-conduit-control-applet.c
@@ -235,6 +235,7 @@ setStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
static void
readStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
{
+/*
GtkWidget *button;
button = gtk_object_get_data(GTK_OBJECT(w), "conduit_on_off");
@@ -242,6 +243,7 @@ readStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
g_assert(button!=NULL);
activated = GTK_TOGGLE_BUTTON(button)->active;
+*/
}
static void
diff --git a/calendar/conduits/calendar/calendar-conduit-control-applet.c b/calendar/conduits/calendar/calendar-conduit-control-applet.c
index fb1aeeadd9..0950772d2e 100644
--- a/calendar/conduits/calendar/calendar-conduit-control-applet.c
+++ b/calendar/conduits/calendar/calendar-conduit-control-applet.c
@@ -235,6 +235,7 @@ setStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
static void
readStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
{
+/*
GtkWidget *button;
button = gtk_object_get_data(GTK_OBJECT(w), "conduit_on_off");
@@ -242,6 +243,7 @@ readStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
g_assert(button!=NULL);
activated = GTK_TOGGLE_BUTTON(button)->active;
+*/
}
static void
diff --git a/calendar/gui/calendar-conduit-control-applet.c b/calendar/gui/calendar-conduit-control-applet.c
index fb1aeeadd9..0950772d2e 100644
--- a/calendar/gui/calendar-conduit-control-applet.c
+++ b/calendar/gui/calendar-conduit-control-applet.c
@@ -235,6 +235,7 @@ setStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
static void
readStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
{
+/*
GtkWidget *button;
button = gtk_object_get_data(GTK_OBJECT(w), "conduit_on_off");
@@ -242,6 +243,7 @@ readStateCfg(GtkWidget *w,GCalConduitCfg *cfg)
g_assert(button!=NULL);
activated = GTK_TOGGLE_BUTTON(button)->active;
+*/
}
static void
compiled contract, including access // to the ABI definition, source mapping, user and developer docs, and metadata. // // Depending on the source, language version, compiler version, and compiler // options will provide information about how the contract was compiled. type ContractInfo struct { Source string `json:"source"` Language string `json:"language"` LanguageVersion string `json:"languageVersion"` CompilerVersion string `json:"compilerVersion"` CompilerOptions string `json:"compilerOptions"` SrcMap string `json:"srcMap"` SrcMapRuntime string `json:"srcMapRuntime"` AbiDefinition interface{} `json:"abiDefinition"` UserDoc interface{} `json:"userDoc"` DeveloperDoc interface{} `json:"developerDoc"` Metadata string `json:"metadata"` } // Solidity contains information about the solidity compiler. type Solidity struct { Path, Version, FullVersion string Major, Minor, Patch int } // --combined-output format type solcOutput struct { Contracts map[string]struct { BinRuntime string `json:"bin-runtime"` SrcMapRuntime string `json:"srcmap-runtime"` Bin, SrcMap, Abi, Devdoc, Userdoc, Metadata string } Version string } func (s *Solidity) makeArgs() []string { p := []string{ "--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc", "--optimize", // code optimizer switched on } if s.Major > 0 || s.Minor > 4 || s.Patch > 6 { p[1] += ",metadata" } return p } // SolidityVersion runs solc and parses its version output. func SolidityVersion(solc string) (*Solidity, error) { if solc == "" { solc = "solc" } var out bytes.Buffer cmd := exec.Command(solc, "--version") cmd.Stdout = &out err := cmd.Run() if err != nil { return nil, err } matches := versionRegexp.FindStringSubmatch(out.String()) if len(matches) != 4 { return nil, fmt.Errorf("can't parse solc version %q", out.String()) } s := &Solidity{Path: cmd.Path, FullVersion: out.String(), Version: matches[0]} if s.Major, err = strconv.Atoi(matches[1]); err != nil { return nil, err } if s.Minor, err = strconv.Atoi(matches[2]); err != nil { return nil, err } if s.Patch, err = strconv.Atoi(matches[3]); err != nil { return nil, err } return s, nil } // CompileSolidityString builds and returns all the contracts contained within a source string. func CompileSolidityString(solc, source string) (map[string]*Contract, error) { if len(source) == 0 { return nil, errors.New("solc: empty source string") } s, err := SolidityVersion(solc) if err != nil { return nil, err } args := append(s.makeArgs(), "--") cmd := exec.Command(s.Path, append(args, "-")...) cmd.Stdin = strings.NewReader(source) return s.run(cmd, source) } // CompileSolidity compiles all given Solidity source files. func CompileSolidity(solc string, sourcefiles ...string) (map[string]*Contract, error) { if len(sourcefiles) == 0 { return nil, errors.New("solc: no source files") } source, err := slurpFiles(sourcefiles) if err != nil { return nil, err } s, err := SolidityVersion(solc) if err != nil { return nil, err } args := append(s.makeArgs(), "--") cmd := exec.Command(s.Path, append(args, sourcefiles...)...) return s.run(cmd, source) } func (s *Solidity) run(cmd *exec.Cmd, source string) (map[string]*Contract, error) { var stderr, stdout bytes.Buffer cmd.Stderr = &stderr cmd.Stdout = &stdout if err := cmd.Run(); err != nil { return nil, fmt.Errorf("solc: %v\n%s", err, stderr.Bytes()) } return ParseCombinedJSON(stdout.Bytes(), source, s.Version, s.Version, strings.Join(s.makeArgs(), " ")) } // ParseCombinedJSON takes the direct output of a solc --combined-output run and // parses it into a map of string contract name to Contract structs. The // provided source, language and compiler version, and compiler options are all // passed through into the Contract structs. // // The solc output is expected to contain ABI, source mapping, user docs, and dev docs. // // Returns an error if the JSON is malformed or missing data, or if the JSON // embedded within the JSON is malformed. func ParseCombinedJSON(combinedJSON []byte, source string, languageVersion string, compilerVersion string, compilerOptions string) (map[string]*Contract, error) { var output solcOutput if err := json.Unmarshal(combinedJSON, &output); err != nil { return nil, err } // Compilation succeeded, assemble and return the contracts. contracts := make(map[string]*Contract) for name, info := range output.Contracts { // Parse the individual compilation results. var abi interface{} if err := json.Unmarshal([]byte(info.Abi), &abi); err != nil { return nil, fmt.Errorf("solc: error reading abi definition (%v)", err) } var userdoc interface{} if err := json.Unmarshal([]byte(info.Userdoc), &userdoc); err != nil { return nil, fmt.Errorf("solc: error reading user doc: %v", err) } var devdoc interface{} if err := json.Unmarshal([]byte(info.Devdoc), &devdoc); err != nil { return nil, fmt.Errorf("solc: error reading dev doc: %v", err) } contracts[name] = &Contract{ Code: "0x" + info.Bin, RuntimeCode: "0x" + info.BinRuntime, Info: ContractInfo{ Source: source, Language: "Solidity", LanguageVersion: languageVersion, CompilerVersion: compilerVersion, CompilerOptions: compilerOptions, SrcMap: info.SrcMap, SrcMapRuntime: info.SrcMapRuntime, AbiDefinition: abi, UserDoc: userdoc, DeveloperDoc: devdoc, Metadata: info.Metadata, }, } } return contracts, nil } func slurpFiles(files []string) (string, error) { var concat bytes.Buffer for _, file := range files { content, err := ioutil.ReadFile(file) if err != nil { return "", err } concat.Write(content) } return concat.String(), nil }